Closed phutchin closed 9 years ago
One suggestion for a fix would be to add a method to FluentCustomisation
which returns JFixture
, allowing you to do:
@Rule public FixtureRule fr = FixtureRule.initFixtures(new JFixture().customise().sameInstance(MyClass.class, myInstance).jfixture());
After a bit more of a think. I think it might be nicer to do
@Rule public FixtureRule fr = FixtureRule.initFixtures().customise().sameInstance(MyClass.class, myInstance)
If using annotated fixtures, then they can be initialized by adding this to the test: @Rule public FixtureRule fr = FixtureRule.initFixtures(new JFixture())
but if I want to customise the fixture, I need to setup the customisations in a constructor, and it makes the tests a bit messy.