Class: Sus::Receive::WithBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/sus/receive.rb

Instance Method Summary collapse

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


149
150
151
# File 'lib/sus/receive.rb', line 149

def print(output)
	output.write("with block", @predicate)
end