Class: RuboCop::RSpec::Example
Overview
Wrapper for RSpec examples
Instance Method Summary
collapse
Methods inherited from Concept
#eql?, #hash, #initialize, #to_node
Methods included from Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#definition ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/rubocop/rspec/example.rb', line 28
def definition
if node.send_type?
node
else
node.send_node
end
end
|
#doc_string ⇒ Object
16
17
18
|
# File 'lib/rubocop/rspec/example.rb', line 16
def doc_string
(definition)
end
|
8
|
# File 'lib/rubocop/rspec/example.rb', line 8
def_node_matcher :extract_doc_string, '(send _ _ $_ ...)'
|
14
|
# File 'lib/rubocop/rspec/example.rb', line 14
def_node_matcher :extract_implementation, '(block send args $_)'
|
11
|
# File 'lib/rubocop/rspec/example.rb', line 11
def_node_matcher :extract_metadata, '(send _ _ _ $...)'
|
#implementation ⇒ Object
24
25
26
|
# File 'lib/rubocop/rspec/example.rb', line 24
def implementation
(node)
end
|
20
21
22
|
# File 'lib/rubocop/rspec/example.rb', line 20
def metadata
(definition)
end
|