Exception: UnexpectedInput
- Inherits:
-
StandardError
- Object
- StandardError
- UnexpectedInput
- Defined in:
- lib/expects/error.rb
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
- #build_message ⇒ Object
-
#initialize(subject = nil, expected = nil) ⇒ UnexpectedInput
constructor
A new instance of UnexpectedInput.
- #message ⇒ Object
Constructor Details
#initialize(subject = nil, expected = nil) ⇒ UnexpectedInput
Returns a new instance of UnexpectedInput.
4 5 6 |
# File 'lib/expects/error.rb', line 4 def initialize(subject = nil, expected = nil) @subject, @expected = subject, expected end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
2 3 4 |
# File 'lib/expects/error.rb', line 2 def expected @expected end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
2 3 4 |
# File 'lib/expects/error.rb', line 2 def subject @subject end |
Instance Method Details
#build_message ⇒ Object
12 13 14 |
# File 'lib/expects/error.rb', line 12 def "Expected #{@subject.inspect} to be #{expected.join(", ")}" end |
#message ⇒ Object
8 9 10 |
# File 'lib/expects/error.rb', line 8 def @message ||= end |