Print the execution time of your slowest RSpec examples.
- RspecPerformanceSummary
- Table of Contents
- Installation
- Usage
- Credit
- Development
- For maintainers
- License
Add the gem to the test
group of your application's Gemfile
. Because the gem is not released via
RubyGems, you will need to install it from GitHub.
group :test do
gem 'rspec_performance_summary', require: false, # we'll require it manually in `spec_helper.rb`
git: 'https://github.com/davidrunger/rspec_performance_summary.git'
end
And then execute:
$ bundle install
Finally, add this to the spec/spec_helper.rb
file in your project:
require 'rspec_performance_summary'
Just run one or more of your RSpec tests! The performance summary should be printed automatically after the tests have completed.
I borrowed this code for the performance logging from https://coderwall.com/p/l3nl_w/measure-spec-execution-time .
I borrowed the general code approach for plugging into RSpec from a gem from rspec-retry.
After checking out the repo, run bundle install
to install dependencies. Then, run bin/rspec
to
run the 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, run bin/release
with an appropriate --type
option, e.g.:
bin/release --type minor
(This uses the release_assistant
gem.)
The gem is available as open source under the terms of the MIT License.