Class: Transpec::Syntax::MethodStub::NoMessageAllowanceRecordBuilder

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

Instance Method Summary collapse

Methods inherited from RecordBuilder

build, #build, param_names

Instance Method Details

#base_syntaxObject



233
234
235
# File 'lib/transpec/syntax/method_stub.rb', line 233

def base_syntax
  "obj.#{method_stub.method_name}(:message)"
end

#new_syntaxObject



229
230
231
# File 'lib/transpec/syntax/method_stub.rb', line 229

def new_syntax
  base_syntax
end

#old_syntaxObject



222
223
224
225
226
227
# File 'lib/transpec/syntax/method_stub.rb', line 222

def old_syntax
  syntax = base_syntax
  syntax << '.any_number_of_times' if method_stub.any_number_of_times?
  syntax << '.at_least(0)' if method_stub.at_least_zero?
  syntax
end