Exception: AssertType::AssertionError
- Defined in:
- lib/assert_type/assertion_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
Instance Method Summary collapse
-
#initialize(expected, actual) ⇒ AssertionError
constructor
A new instance of AssertionError.
- #message ⇒ Object
Constructor Details
#initialize(expected, actual) ⇒ AssertionError
Returns a new instance of AssertionError.
8 9 10 11 |
# File 'lib/assert_type/assertion_error.rb', line 8 def initialize expected, actual @expected = expected @actual = actual end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
6 7 8 |
# File 'lib/assert_type/assertion_error.rb', line 6 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
6 7 8 |
# File 'lib/assert_type/assertion_error.rb', line 6 def expected @expected end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/assert_type/assertion_error.rb', line 13 def "assertion failed - expected #{@expected} but was #{@actual}" end |