lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-2.31.0 vs lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-3.0.0.pre
- old
+ new
@@ -105,11 +105,14 @@
end
private
def ignored_shared_example?(node)
- cop_config['IgnoreSharedExamples'] &&
- node.each_ancestor(:block).any?(&method(:shared_example?))
+ return false unless cop_config['IgnoreSharedExamples']
+
+ node.each_ancestor(:block).any? do |ancestor|
+ shared_example?(ancestor)
+ end
end
def check_explicit_subject(node)
return if allow_explicit_subject?(node)