Module: Transpec::Syntax::AnyNumberOfTimesable

Included in:
MethodStub, ShouldReceive
Defined in:
lib/transpec/syntax/any_number_of_timesable.rb

Instance Method Summary collapse

Instance Method Details

#any_number_of_times?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/transpec/syntax/any_number_of_timesable.rb', line 8

def any_number_of_times?
  !any_number_of_times_node.nil?
end

#remove_any_number_of_times!Object



12
13
14
15
16
17
18
# File 'lib/transpec/syntax/any_number_of_timesable.rb', line 12

def remove_any_number_of_times!
  return unless any_number_of_times?

  map = any_number_of_times_node.loc
  dot_any_number_of_times_range = map.dot.join(map.selector)
  remove(dot_any_number_of_times_range)
end