Skip to content

Commit

Permalink
Add Andrew to the hall of fame
Browse files Browse the repository at this point in the history
For his incredible work on #925
  • Loading branch information
pirj committed Jun 11, 2020
1 parent 7f56f41 commit 686b1a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@
* Add new `SpecSuffixOnly` option to `RSpec/FilePath` cop. ([@zdennis][])
* Allow `RSpec/RepeatedExampleGroupBody` to differ only by described_class. ([@robotdana][])
* Fix `RSpec/FilePath` detection across sibling directories. ([@rolfschmidt][])
* Improve the performance of `RSpec/SubjectStub` by an order of magnitude. ([@andrykonchin][])

## 1.39.0 (2020-05-01)

Expand Down Expand Up @@ -514,3 +515,4 @@ Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
[@zdennis]: https://github.com/zdennis
[@robotdana]: https://github.com/robotdana
[@rolfschmidt]: https://github.com/rolfschmidt
[@andrykonchin]: https://github.com/andrykonchin
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/subject_stub.rb
Expand Up @@ -77,7 +77,7 @@ class SubjectStub < Cop

def on_block(node)
return unless example_group?(node)
return unless (processed_example_groups & node.ancestors).empty?
return if (processed_example_groups & node.ancestors).any?

processed_example_groups << node
@explicit_subjects = find_all_explicit_subjects(node)
Expand All @@ -94,7 +94,7 @@ def processed_example_groups
end

def find_all_explicit_subjects(node)
node.each_descendant(:block).each_with_object({}) do |child, h|
node.each_descendant(:block).with_object({}) do |child, h|
name = subject(child)
next unless name

Expand Down

0 comments on commit 686b1a8

Please sign in to comment.