Class: Transpec::Syntax::ShouldReceive::StubRecord

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

Instance Method Summary collapse

Methods inherited from Record

#==, #hash, #to_s

Constructor Details

#initialize(should_receive) ⇒ StubRecord

Returns a new instance of StubRecord.



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

def initialize(should_receive, *)
  @should_receive = should_receive
end

Instance Method Details

#converted_syntaxObject



224
225
226
# File 'lib/transpec/syntax/should_receive.rb', line 224

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

#original_syntaxObject



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

def original_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