Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

PR 2280 followups #2284

Merged
merged 3 commits into from
Jul 7, 2016
Merged

PR 2280 followups #2284

merged 3 commits into from
Jul 7, 2016

Conversation

myronmarston
Copy link
Member

@eugeneius -- can you review my refactoring here and confirm my refactoring here is functionality equivalent to what you had before?


until groups.empty?
group = groups.shift
def add_hook_to_exisiting_matching_groups(meta, scope, &block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exisiting -> existing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks.

@eugeneius
Copy link
Contributor

This looks great - traversing the example group hierarchy is much clearer 👍

- Use a functional style using recursion instead of
  mutating a `groups` array imperatively. I find a
  functional style easier to reason about.
- Split off the hook-specific logic, but preserve
  the general traversal logic.
- Remove duplication of `Metadata.build_hash_from`.
- Only call `Metadata.build_hash_from` if needed. If
  we are dealing with an :example hook there is no need.
@myronmarston myronmarston force-pushed the myron/pr-2280-followups branch from 58eaac6 to 0c700e8 Compare July 7, 2016 03:06
@myronmarston
Copy link
Member Author

@rspec/rspec can someone review this? Then I'll merge and get this (and #2280) released in 3.5.1.

@JonRowe JonRowe merged commit 240b974 into master Jul 7, 2016
@JonRowe JonRowe deleted the myron/pr-2280-followups branch July 7, 2016 03:55
@JonRowe
Copy link
Member

JonRowe commented Jul 7, 2016

Good work!

MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants