Module: Transpec::Syntax::Mixin::NoMessageAllowance

Extended by:
ActiveSupport::Concern
Includes:
AST::Sexp, Send
Included in:
MessagingHost
Defined in:
lib/transpec/syntax/mixin/no_message_allowance.rb

Instance Method Summary collapse

Methods included from Send

#arg_node, #arg_nodes, #arg_range, #args_range, #method_name, #parentheses_range, #range_after_arg, #range_in_between_receiver_and_selector, #range_in_between_selector_and_arg, #receiver_node, #receiver_range, #selector_range

Methods included from Send::TargetDetection

#conversion_target?, #dynamic_analysis_target?

Instance Method Details

#allow_no_message?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/transpec/syntax/mixin/no_message_allowance.rb', line 15

def allow_no_message?
  any_number_of_times? || at_least_zero?
end

#any_number_of_times?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/transpec/syntax/mixin/no_message_allowance.rb', line 24

def any_number_of_times?
  any_number_of_times_node
end

#at_least_zero?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/transpec/syntax/mixin/no_message_allowance.rb', line 28

def at_least_zero?
  at_least_zero_node
end

#remove_no_message_allowance!Object



19
20
21
22
# File 'lib/transpec/syntax/mixin/no_message_allowance.rb', line 19

def remove_no_message_allowance!
  remove_any_number_of_times!
  remove_at_least_zero!
end