Class: Mspec::SpecResult
- Inherits:
-
Object
- Object
- Mspec::SpecResult
- Defined in:
- lib/m-spec/core/spec_result.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expectation, matcher, error) ⇒ SpecResult
constructor
A new instance of SpecResult.
- #success? ⇒ Boolean
- #trace ⇒ Object
Constructor Details
#initialize(expectation, matcher, error) ⇒ SpecResult
Returns a new instance of SpecResult.
3 4 5 6 7 |
# File 'lib/m-spec/core/spec_result.rb', line 3 def initialize(expectation, matcher, error) @test_code = expectation @expected_result = matcher @error = error end |
Instance Method Details
#failure_message ⇒ Object
13 14 15 16 17 18 |
# File 'lib/m-spec/core/spec_result.rb', line 13 def [ "Expected: ".rjust(10) + "#{@expected_result.value.inspect}", "Got: ".rjust(10) + "#{test_code_result.inspect}", ] end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/m-spec/core/spec_result.rb', line 9 def success? !@error end |
#trace ⇒ Object
20 21 22 |
# File 'lib/m-spec/core/spec_result.rb', line 20 def trace "#{@error.backtrace[1]}" end |