cucumber/cucumber-jvm — Issue #77: Throw exception if @RunWith(Cucumber.class) classes have methods.
Author: aslakhellesoy
Created: 2011-10-28 21:37:17+00:00
State: open
Labels: JUnit

People are bound to misuse classes annotated with @RunWith(Cucumber.class) by putting stepdefs in them. This is bad because it couples stepdefs to features, and confuses people. In fact, two instances of the class will be created. -One by JUnit and one by the DI container.

@RunWith(Cucumber.class) annotated classes are meant to be empty and should serve a single purpose: kick of cucumber to run a feature.

Forcing users to put stepdefs elsewhere will hopefully help them understand the difference.