Class: Turn::TestMethod
- Inherits:
-
Object
- Object
- Turn::TestMethod
- Defined in:
- lib/turn/components/method.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #error!(message = nil) ⇒ Object
- #error? ⇒ Boolean
- #fail!(message = nil) ⇒ Object
- #fail? ⇒ Boolean
-
#initialize(name) ⇒ TestMethod
constructor
A new instance of TestMethod.
- #pass? ⇒ Boolean
Constructor Details
#initialize(name) ⇒ TestMethod
Returns a new instance of TestMethod.
9 10 11 12 13 14 |
# File 'lib/turn/components/method.rb', line 9 def initialize(name) @name = name @fail = false @error = false @message = nil end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
6 7 8 |
# File 'lib/turn/components/method.rb', line 6 def file @file end |
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/turn/components/method.rb', line 7 def @message end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/turn/components/method.rb', line 5 def name @name end |
Instance Method Details
#error!(message = nil) ⇒ Object
21 22 23 24 |
# File 'lib/turn/components/method.rb', line 21 def error!(=nil) @fail, @error = false, true @message = if end |
#error? ⇒ Boolean
27 |
# File 'lib/turn/components/method.rb', line 27 def error? ; @error ; end |
#fail!(message = nil) ⇒ Object
16 17 18 19 |
# File 'lib/turn/components/method.rb', line 16 def fail!(=nil) @fail, @error = true, false @message = if end |
#fail? ⇒ Boolean
26 |
# File 'lib/turn/components/method.rb', line 26 def fail? ; @fail ; end |
#pass? ⇒ Boolean
28 |
# File 'lib/turn/components/method.rb', line 28 def pass? ; !(@fail or @error) ; end |