Class: Turn::TestMethod
- Inherits:
-
Object
- Object
- Turn::TestMethod
- Defined in:
- lib/turn/components/method.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#file ⇒ Object
Returns the value of attribute file.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raised ⇒ Object
Returns the value of attribute raised.
Instance Method Summary collapse
- #error!(exception) ⇒ Object
- #error? ⇒ Boolean
- #fail!(assertion) ⇒ Object
- #fail? ⇒ Boolean
-
#initialize(name) ⇒ TestMethod
constructor
A new instance of TestMethod.
- #pass? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ TestMethod
Returns a new instance of TestMethod.
11 12 13 14 15 16 17 18 |
# File 'lib/turn/components/method.rb', line 11 def initialize(name) @name = name @fail = false @error = false @raised = nil @message = nil @backtrace = [] end |
Instance Attribute Details
#backtrace ⇒ Object
Returns the value of attribute backtrace.
9 10 11 |
# File 'lib/turn/components/method.rb', line 9 def backtrace @backtrace end |
#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.
8 9 10 |
# File 'lib/turn/components/method.rb', line 8 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 |
#raised ⇒ Object
Returns the value of attribute raised.
7 8 9 |
# File 'lib/turn/components/method.rb', line 7 def raised @raised end |
Instance Method Details
#error!(exception) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/turn/components/method.rb', line 27 def error!(exception) @fail, @error = false, true @raised = exception @message = exception. @backtrace = exception.backtrace end |
#error? ⇒ Boolean
35 |
# File 'lib/turn/components/method.rb', line 35 def error? ; @error ; end |
#fail!(assertion) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/turn/components/method.rb', line 20 def fail!(assertion) @fail, @error = true, false @raised = assertion @message = assertion. @backtrace = assertion.backtrace end |
#fail? ⇒ Boolean
34 |
# File 'lib/turn/components/method.rb', line 34 def fail? ; @fail ; end |
#pass? ⇒ Boolean
36 |
# File 'lib/turn/components/method.rb', line 36 def pass? ; !(@fail or @error) ; end |
#to_s ⇒ Object
38 |
# File 'lib/turn/components/method.rb', line 38 def to_s ; name ; end |