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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RecordBuilder

build, #build

Constructor Details

#initialize(method_stub) ⇒ NoMessageAllowanceRecordBuilder

Returns a new instance of NoMessageAllowanceRecordBuilder.



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

def initialize(method_stub)
  @method_stub = method_stub
end

Instance Attribute Details

#method_stub ⇒ Object (readonly)

Returns the value of attribute method_stub.



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

def method_stub
  @method_stub
end

Instance Method Details

#base_syntax ⇒ Object



247
248
249
# File 'lib/transpec/syntax/method_stub.rb', line 247

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

#new_syntax ⇒ Object



243
244
245
# File 'lib/transpec/syntax/method_stub.rb', line 243

def new_syntax
  base_syntax
end

#old_syntax ⇒ Object



236
237
238
239
240
241
# File 'lib/transpec/syntax/method_stub.rb', line 236

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