Class: Transpec::Syntax::ShouldReceive::StubRecordBuilder

Inherits:
RecordBuilder
  • Object
show all
Defined in:
lib/transpec/syntax/should_receive.rb

Instance Method Summary collapse

Methods inherited from RecordBuilder

build, #build, param_names

Instance Method Details

#new_syntaxObject



220
221
222
# File 'lib/transpec/syntax/should_receive.rb', line 220

def new_syntax
  'obj.stub(:message)'
end

#old_syntaxObject



213
214
215
216
217
218
# File 'lib/transpec/syntax/should_receive.rb', line 213

def old_syntax
  syntax = "obj.#{should_receive.method_name}(:message)"
  syntax << '.any_number_of_times' if should_receive.any_number_of_times?
  syntax << '.at_least(0)' if should_receive.at_least_zero?
  syntax
end