RspecTimer
RSpecTimer will track the amount of time each of your tests take to complete, and when it's done, can save the data to a YAML file.
Installation
Add this line to your application's Gemfile:
gem 'rspec_timer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec_timer
Usage
In your spec_helper.rb file, set up your "around" and "after" hooks like so:
RSpec.configure do |config|
config.around(:each) do |example|
RspecTimer.run_and_measure(example)
end
config.after(:suite) do
RspecTimer.save_metrics_to_file(Rails.root.join('rspec_metrics.yml').to_s)
end
end
Contributing
- Fork it ( https://github.com/tomchapin/rspec_timer/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request