Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(context): reduce responsibilities taken by Context, ClassContext, ExampleBase #193

Merged
merged 27 commits into from
Jun 12, 2017

Conversation

BrainCrumbz
Copy link
Collaborator

@BrainCrumbz BrainCrumbz commented May 23, 2017

Main purpose of this PR is to streamline the logic behind:

  • building chains of method level hooks;
  • running chains of hooks through ancestor levels,
  • running the example itself,
  • setting example exception.

At the same time, this happens while extracting those responsibilities out of Context, ClassContext and ExampleBase, and moving those to dedicated components.

Some results:

  • Context is much shorter now and more approachable
  • repeated code related to discovering method-level hooks is now shared in a single base class
  • repeated properties and methods related to running hooks through ancestor levels are now shared in a base class or two
  • determining whether a hook can run or not is always in a dedicated CanRun method
  • exception collected running through a hook chain is always available in a AnyException method
  • all responsibilities related to running an example in its context, assigning right exception, writing outcome to formatter, are all to be found in a dedicated RunnableExample class
  • write access to properties in Context, ClassContext and ExampleBase is protected, to ease understanding what can be modified outside of class

Giuseppe Piscopo and others added 27 commits May 22, 2017 01:17
@GiuseppePiscopo GiuseppePiscopo merged commit 8237494 into master Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants