DerailsSpecs boots puma and provides a GET route (/reset-transaction) in which rollbacks your transaction and begins a new transaction for the next te

roshreview / derail_specs Public

submited by
Style Pass
2021-09-25 16:30:09

DerailsSpecs boots puma and provides a GET route (/reset-transaction) in which rollbacks your transaction and begins a new transaction for the next test. At the end of the test suite, it rollbacks the final transaction.

Alternatively, if you don't set a config.command, the server will boot in infinite mode and will not stop until receiving an INT signal (IE Ctrl+c). This is good for when your test command isn't available in a rails context, like when you are running rails in docker, but have a test application running on the host machine.

By default, DerailSpecs doesn't run any fixtures. You can configure global fixture loading with initializer hooks in config/initializers/derail_specs.rb:

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the rspec tests and bin/test to run all tests, including sample rails app tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Leave a Comment
Related Posts