Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simplecov-single_file_reporter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplecov-single_file_reporter

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

print coverage for 1 test/spec file

Install

gem install simplecov-single_file_reporter

Usage

Simple setup

Print coverage percent when you run a single file

require "simplecov/single_file_reporter"
SimpleCov.start
SimpleCov::SingleFileReporter.print
ruby test/a_test.rb
1 tests, 1 assertions
lib/a.rb coverage: 80.0

Customizing file-finding rules

SingleFileReporter needs to find the file that is tested.

test/test_xxx.rb -> lib/xxx.rb or app/xxx.rb

If it's something common, make a pull request.
If your app has special rules you can add them:

class MyReporter < SimpleCov::SingleFileReporter
  remove :file_under_test
  def self.file_under_test(test_file)
    super(test_file) || test_file.split("test/").last.sub("foo", "bar").sub("_test.rb", ".rb")
  end
end

SimpleCov.start
MyReporter.print

Authors

Contributors

Michael Grosser
michael@grosser.it
License: MIT
Build Status

FAQs

Package last updated on 06 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc