Renamed Subject to Specification #447

Merged
merged 3 commits into from Feb 11, 2014

Conversation

Projects
None yet
2 participants
Owner

everzet commented Feb 8, 2014

Following confusion (rightful) of @docteurklein, misnaming of Subject became very apparent. There are two misleading objects in the Testwork right now:

  • Subject in Behat\Testwork\Tester\SubjectTester and Behat\Testwork\Subject
  • $testSubject in EnvironmentHandler::isolateEnvironment($environment, $testSubject = null)

I think original meaning of $testSubject in case of EnvironmentHandler is very close to the notion of test subject. So misnaming definitely doesn't happen there.

In case of SubjectTester and SubjectFinder though, I don't think we did a great job at naming this thing. Subject in those case is not only too vague, but also a misleading term put together with EnvironmentHandler behaviour. What we actually are trying to talk about is a test specification - subset of tests, next layer under the test suite.

This PR solves the potential confusion of framework writer by clarifying intention and goal behind Subject-thingy by renaming it into Specification. From now on, it's SpecificationTester and SpecificationFinder. I really think new names communicate much better and eliminate possible confusions behind their use-cases.

everzet added some commits Feb 8, 2014

@everzet everzet Renamed SubjectTester to SpecificationTester
It was really confusing before what is a Subject in SubjectTester and
what is a testSubject in EnvironmentHandler. In fact, for most test
frameworks those things are different. Thus, this renaming should bring
more clarity to test framework writers (hopefully).
33bc4aa
@everzet everzet StepContainerTester passes container during environment isolation
For Behat, actual testSubject (or point of isolation) is a scenario or
outline example itself, not the whole feature. This doesn't make any
technical difference for how Behat's EnvironmentHandler works, but
hopefully will clarify things a lot to custom frameworks writers that
read Behat code as a reference point.
7d0c24e
@everzet everzet Behat\Testwork\Subject moved to Behat\Testwork\Specification
Following previous changes, it makes sense to group all specification-
related functionality under the consistent Specification namespace.
Following this new rule:

- Behat\Testwork\Subject\SubjectFinder became
  Behat\Testwork\Specification\SpecificationFinder

- Behat\Testwork\Subject\Locator\SubjectLocator became
  Behat\Testwork\Specification\Locator\SpecificationLocator

I think new namespace and names do much better job at communicating
their objects intention and clarifying the extension points.
67c8c75
Member

docteurklein commented Feb 8, 2014

all good!

everzet added this to the 3.0.0 milestone Feb 8, 2014

everzet added the optimization label Feb 8, 2014

@everzet everzet added a commit that referenced this pull request Feb 11, 2014

@everzet everzet Merge pull request #447 from Behat/optimization/subject-to-specification
Renamed Subject to Specification
df94075

@everzet everzet merged commit df94075 into 3.0 Feb 11, 2014

1 check passed

default Scrutinizer: 4 new/changed issues, 56 added/modified code elements — Travis: Passed
Details

everzet deleted the optimization/subject-to-specification branch Feb 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment