Class: Sus::Receive::Times

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

Constant Summary collapse

ONCE =
Be.new(:==, 1)

Instance Method Summary collapse

Constructor Details

#initialize(condition = ONCE) ⇒ Times

Returns a new instance of Times.



164
165
166
# File 'lib/sus/receive.rb', line 164

def initialize(condition = ONCE)
	@condition = condition
end

Instance Method Details

#call(assertions, subject) ⇒ Object



172
173
174
175
176
# File 'lib/sus/receive.rb', line 172

def call(assertions, subject)
	assertions.nested(self) do |assertions|
		Expect.new(assertions, subject).to(@condition)
	end
end


168
169
170
# File 'lib/sus/receive.rb', line 168

def print(output)
	output.write("with call count ", @condition)
end