lib/rubocop/rspec/language.rb in rubocop-rspec-1.8.0 vs lib/rubocop/rspec/language.rb in rubocop-rspec-1.9.0

- old
+ new

@@ -20,19 +20,35 @@ def include?(selector) selectors.include?(selector) end - def to_node_pattern + def block_pattern + "(block #{send_pattern} ...)" + end + + def send_pattern + "(send _ #{node_pattern_union} ...)" + end + + def node_pattern_union + "{#{node_pattern}}" + end + + def node_pattern selectors.map(&:inspect).join(' ') end protected attr_reader :selectors end + module Matchers + MESSAGE_CHAIN = SelectorSet.new(%i(receive_message_chain stub_chain)) + end + module ExampleGroups GROUPS = SelectorSet.new(%i(describe context feature example_group)) SKIPPED = SelectorSet.new(%i(xdescribe xcontext xfeature)) FOCUSED = SelectorSet.new(%i(fdescribe fcontext ffeature)) @@ -40,9 +56,20 @@ end module SharedGroups ALL = SelectorSet.new( %i(shared_examples shared_context shared_examples_for) + ) + end + + module Includes + ALL = SelectorSet.new( + %i( + it_behaves_like + it_should_behave_like + include_context + include_examples + ) ) end module Examples EXAMPLES = SelectorSet.new(%i(it specify example scenario its))