Class: Confiner::Example
- Inherits:
-
Object
- Object
- Confiner::Example
- Defined in:
- lib/confiner/example.rb
Overview
Representation of an example (test)
Instance Attribute Summary collapse
-
#classname ⇒ Object
Returns the value of attribute classname.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#occurrence ⇒ Object
Returns the value of attribute occurrence.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#failed? ⇒ Boolean
Check if this example had failed.
-
#initialize(**attributes) {|_self| ... } ⇒ Example
constructor
A new instance of Example.
-
#passed? ⇒ Boolean
Check if this example had passed.
-
#skipped? ⇒ Boolean
Check if this example had been skipped.
- #to_s ⇒ Object
Constructor Details
#initialize(**attributes) {|_self| ... } ⇒ Example
Returns a new instance of Example.
8 9 10 11 12 13 14 15 16 |
# File 'lib/confiner/example.rb', line 8 def initialize(**attributes) @status = attributes.fetch('status') { attributes.fetch(:status) } @name = attributes.fetch('name') { attributes.fetch(:name) } @classname = attributes.fetch('classname') { attributes.fetch(:classname) } @file = attributes.fetch('file') { attributes.fetch(:file) } @occurrence = attributes.fetch('occurrence') { attributes.fetch(:occurrence) } yield(self) if block_given? end |
Instance Attribute Details
#classname ⇒ Object
Returns the value of attribute classname.
6 7 8 |
# File 'lib/confiner/example.rb', line 6 def classname @classname end |
#file ⇒ Object
Returns the value of attribute file.
6 7 8 |
# File 'lib/confiner/example.rb', line 6 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/confiner/example.rb', line 6 def name @name end |
#occurrence ⇒ Object
Returns the value of attribute occurrence.
6 7 8 |
# File 'lib/confiner/example.rb', line 6 def occurrence @occurrence end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/confiner/example.rb', line 6 def status @status end |
Instance Method Details
#failed? ⇒ Boolean
Check if this example had failed
26 27 28 |
# File 'lib/confiner/example.rb', line 26 def failed? status == 'failed' end |
#passed? ⇒ Boolean
Check if this example had passed
20 21 22 |
# File 'lib/confiner/example.rb', line 20 def passed? status == 'success' end |
#skipped? ⇒ Boolean
Check if this example had been skipped
32 33 34 |
# File 'lib/confiner/example.rb', line 32 def skipped? status == 'skipped' end |
#to_s ⇒ Object
36 |
# File 'lib/confiner/example.rb', line 36 def to_s; name; end |