Class: Kontrast::Test
- Inherits:
-
Object
- Object
- Kontrast::Test
- Defined in:
- lib/kontrast/test.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #bind_spec(spec) ⇒ Object
-
#initialize(prefix, name, path, headers: {}) ⇒ Test
constructor
A new instance of Test.
-
#run_callback(name, *args) ⇒ Object
Usage: test.run_callback(:before_screenshot, arg1, arg2, arg3).
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(prefix, name, path, headers: {}) ⇒ Test
Returns a new instance of Test.
5 6 7 |
# File 'lib/kontrast/test.rb', line 5 def initialize(prefix, name, path, headers: {}) @prefix, @name, @path, @headers = prefix, name, path, headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/kontrast/test.rb', line 3 def headers @headers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/kontrast/test.rb', line 3 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/kontrast/test.rb', line 3 def path @path end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
3 4 5 |
# File 'lib/kontrast/test.rb', line 3 def prefix @prefix end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
3 4 5 |
# File 'lib/kontrast/test.rb', line 3 def spec @spec end |
Instance Method Details
#bind_spec(spec) ⇒ Object
9 10 11 |
# File 'lib/kontrast/test.rb', line 9 def bind_spec(spec) @spec = spec end |
#run_callback(name, *args) ⇒ Object
Usage: test.run_callback(:before_screenshot, arg1, arg2, arg3)
14 15 16 17 |
# File 'lib/kontrast/test.rb', line 14 def run_callback(name, *args) return if @spec.nil? @spec.send(name.to_sym, *args) end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/kontrast/test.rb', line 19 def to_s return "#{@prefix}_#{@name}" end |
#to_str ⇒ Object
23 24 25 |
# File 'lib/kontrast/test.rb', line 23 def to_str return to_s end |