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

Allow users to disable database_cleaner hooks #232

Merged
merged 1 commit into from
Mar 4, 2013

Conversation

urbanautomaton
Copy link

Per the discussion in #215, this PR provides an option controlling the automatic invocation of DatabaseCleaner.start before every scenario, and DatabaseCleaner.clean afterwards (it defaults to true, naturally):

# features/support/env.rb
# ...
Cucumber::Rails::Database.autorun_database_cleaner = false

I added the option as an accessor on Cucumber::Rails::Database following the example of .javascript_strategy - it seemed the most natural place for it to live, but I'm happy to take alternative suggestions. :)

Cheers,
Simon

(p.s. the failing scenario is broken in master, too - wasn't me guv, honest.)

@aslakhellesoy
Copy link
Contributor

Code LGTM. Travis failed for an unrelated reason - we can no longer assume mongodb is running on a travis slave. Let's just disable the mongo test when running on Travis.

The hooks that automatically invoke database_cleaner before every
scenario can sometimes cause problems when switching cleaning strategies
between scenarios (issue cucumber#215).

To allow a user to take full control of when database_cleaner is
invoked, the configuration option
Cucumber::Rails::Database.autorun_database_cleaner is provided,
defaulting to true.
Kosmas added a commit that referenced this pull request Mar 4, 2013
Allow users to disable database_cleaner hooks
@Kosmas Kosmas merged commit 7c57290 into cucumber:master Mar 4, 2013
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.

3 participants