Class: Sus::Receive::WithBlock
- Inherits:
-
Object
- Object
- Sus::Receive::WithBlock
- Defined in:
- lib/sus/receive.rb
Instance Method Summary collapse
- #call(assertions, subject) ⇒ Object
-
#initialize(predicate) ⇒ WithBlock
constructor
A new instance of WithBlock.
- #print(output) ⇒ Object
Constructor Details
#initialize(predicate) ⇒ WithBlock
Returns a new instance of WithBlock.
145 146 147 |
# File 'lib/sus/receive.rb', line 145 def initialize(predicate) @predicate = predicate end |
Instance Method Details
#call(assertions, subject) ⇒ Object
153 154 155 156 157 158 |
# File 'lib/sus/receive.rb', line 153 def call(assertions, subject) assertions.nested(self) do |assertions| Expect.new(assertions, subject).not.to(Be == nil) end end |
#print(output) ⇒ Object
149 150 151 |
# File 'lib/sus/receive.rb', line 149 def print(output) output.write("with block", @predicate) end |