Class: Transpec::Syntax::Allow

Inherits:
Syntax
  • Object
show all
Includes:
Mixin::ExpectBase
Defined in:
lib/transpec/syntax/allow.rb

Instance Method Summary collapse

Methods included from Mixin::ExpectBase

#block_node, #current_syntax_type, #matcher_node, #positive?, #subject_node, #subject_range, #to_node

Methods included from Mixin::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 Mixin::Send::TargetDetection

#conversion_target?

Methods included from Mixin::MatcherOwner

#dependent_syntaxes

Instance Method Details

#any_instance?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/transpec/syntax/allow.rb', line 19

def any_instance?
  method_name == :allow_any_instance_of
end

#dynamic_analysis_target?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/transpec/syntax/allow.rb', line 11

def dynamic_analysis_target?
  super && receiver_node.nil? && [:allow, :allow_any_instance_of].include?(method_name)
end

#method_name_for_instanceObject



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

def method_name_for_instance
  :allow
end