A Ruby gem that reports test results from Minitest and RSpec to the Lizard API service.
Add this line to your application's Gemfile:
gem 'lizard'And then execute:
$ bundle install
Or install it yourself as:
$ gem install lizard
Configure the gem with your Lizard API credentials:
Lizard.configure do |config|
config.api_key = "your_api_key"
config.url = "https://your-lizard-instance.com"
endAlternatively, you can use environment variables:
export LIZARD_API_KEY="your_api_key"
export LIZARD_URL="https://your-lizard-instance.com"Add the reporter to your test helper:
require 'lizard'
Minitest.reporter = Lizard::MinitestReporter.newAdd the formatter to your .rspec file:
--require lizard
--format Lizard::RSpecFormatter
Or configure it in your spec_helper.rb:
require 'lizard'
RSpec.configure do |config|
config.add_formatter(Lizard::RSpecFormatter)
endThe gem reports the following data to the Lizard API:
commit_sha: Git commit SHA (fromGITHUB_SHAenvironment variable orgit rev-parse HEAD)branch: Git branch name (fromGITHUB_REF_NAMEenvironment variable orgit branch --show-current)ruby_specs: Number of tests/examples runjs_specs: Always 0 (for compatibility)runtime: Test execution timecoverage: Code coverage percentage (if SimpleCov is available)ran_at: Timestamp when tests were run
After checking out the repo, run bin/setup to install dependencies. Then, run bin/rake test 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, 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.
Bug reports and pull requests are welcome on GitHub at https://github.com/djbender/lizard.
The gem is available as open source under the terms of the MIT License.