Class: Kontrast::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/kontrast/spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Spec

Returns a new instance of Spec.



5
6
7
# File 'lib/kontrast/spec.rb', line 5

def initialize(name)
    @name = name
end

Instance Attribute Details

#_after_screenshotObject

Returns the value of attribute _after_screenshot.



3
4
5
# File 'lib/kontrast/spec.rb', line 3

def _after_screenshot
  @_after_screenshot
end

#_before_screenshotObject

Returns the value of attribute _before_screenshot.



3
4
5
# File 'lib/kontrast/spec.rb', line 3

def _before_screenshot
  @_before_screenshot
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/kontrast/spec.rb', line 3

def name
  @name
end

Instance Method Details

#after_screenshot(test_driver, production_driver, current_test) ⇒ Object



15
16
17
18
19
# File 'lib/kontrast/spec.rb', line 15

def after_screenshot(test_driver, production_driver, current_test)
    if @_after_screenshot
        @_after_screenshot.call(test_driver, production_driver, current_test)
    end
end

#before_screenshot(test_driver, production_driver, current_test) ⇒ Object



9
10
11
12
13
# File 'lib/kontrast/spec.rb', line 9

def before_screenshot(test_driver, production_driver, current_test)
    if @_before_screenshot
        @_before_screenshot.call(test_driver, production_driver, current_test)
    end
end