Class: Expects::Handlers::Proc
- Inherits:
-
Expects::Handler
- Object
- Expects::Handler
- Expects::Handlers::Proc
- Includes:
- Expects
- Defined in:
- lib/expects/handlers/proc.rb
Constant Summary
Constants included from Expects
Instance Attribute Summary
Attributes inherited from Expects::Handler
Instance Method Summary collapse
- #build_message ⇒ Object
-
#initialize(subject, objects) ⇒ Proc
constructor
A new instance of Proc.
- #valid? ⇒ Boolean
Methods included from Expects
Methods inherited from Expects::Handler
Constructor Details
#initialize(subject, objects) ⇒ Proc
Returns a new instance of Proc.
6 7 8 9 |
# File 'lib/expects/handlers/proc.rb', line 6 def initialize(subject, objects) expects objects, ::Proc super end |
Instance Method Details
#build_message ⇒ Object
15 16 17 |
# File 'lib/expects/handlers/proc.rb', line 15 def "Expected #{@subject.inspect} to get a true from the proc" end |
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/expects/handlers/proc.rb', line 11 def valid? @objects.call(@subject) end |