module Juxtapose

Constants

MAX_ATTEMPTS
VERSION

Public Class Methods

extended(base) click to toggle source
# File lib/juxtapose/screenshotter.rb, line 2
def self.extended(base)
  if defined?(::Bacon::Specification)
    ::Bacon::Specification.class_eval do
      @@juxtapatched ||= nil

      unless @@juxtapatched
        alias_method :original_run_spec_block, :run_spec_block
        @@juxtapatched = true

        def run_spec_block
          Thread.current["CURRENT_SPEC_DESCRIPTION"] = @description
          original_run_spec_block
        end
      end
    end
  end
end

Public Instance Methods

it_should_look_like(template, fuzz_factor = 0) click to toggle source
# File lib/juxtapose/screenshotter.rb, line 26
def it_should_look_like(template, fuzz_factor = 0)
  looks_like?(template, fuzz_factor).should.be.true
end
looks_like?(template, fuzz_factor=0) click to toggle source
# File lib/juxtapose/screenshotter.rb, line 22
def looks_like?(template, fuzz_factor=0)
  Screenshotter.new(self, template, fuzz_factor).attempt_verify(MAX_ATTEMPTS)
end
run_spec_block() click to toggle source
# File lib/juxtapose/screenshotter.rb, line 11
def run_spec_block
  Thread.current["CURRENT_SPEC_DESCRIPTION"] = @description
  original_run_spec_block
end