Module: Transpec::Syntax::Mixin::ShouldBase
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
#conversion_target?, #dynamic_analysis_target?
#dependent_syntaxes
Instance Method Details
#current_syntax_type ⇒ Object
24
25
26
|
# File 'lib/transpec/syntax/mixin/should_base.rb', line 24
def current_syntax_type
@current_syntax_type ||= :should
end
|
#matcher_node ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/transpec/syntax/mixin/should_base.rb', line 32
def matcher_node
if arg_node
Util.each_forward_chained_node(arg_node, :include_origin)
.select(&:send_type?).to_a.last
else
parent_node
end
end
|
#positive? ⇒ Boolean
28
29
30
|
# File 'lib/transpec/syntax/mixin/should_base.rb', line 28
def positive?
method_name == :should
end
|
#should_range ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/transpec/syntax/mixin/should_base.rb', line 41
def should_range
if arg_node
selector_range
else
selector_range.join(expression_range.end)
end
end
|