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

minitest-jsonapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minitest-jsonapi

  • 1.5.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Minitest::Jsonapi

Sends JSON output for Minitest runs to console or to a specific URL via POST with a predefined API key and value.

Installation

Add this line to your application's Gemfile:

gem 'minitest-jsonapi', require: false

And then execute:

> bundle

Or install it yourself as:

> gem install minitest-jsonapi

Usage

From terminal


To generate reports using Minitest::JsonApi, you'll need to pass -J or --json flag to Minitest on the command line.

Following will produce the output on the terminal:

> ruby test/foo_test.rb -J

Options to specify the URL and API keys & values:

> ruby test/foo_test.rb -J --addr=http://localhost:4567 --keyname=ABCD --keyvalue=EFGH

To prettify the JSON for terminal output:

> ruby test/foo_test.rb -J --pretty

All options are optional.

All the options can be viewed by using -h for help:

> ruby test/foo_test.rb -h

From rakefile


You can set up a rake task to run all your tests by adding this to your Rakefile:

require "rake/testtask"

Rake::TestTask.new(:test) do |t|
	t.options = '-J --addr=http://localhost:4567/ --keyname=ABCD --keyvalue=EFGH'
	t.test_files = FileList["test/**/test_*.rb"]
end

task :default => :test

You can also switch on JSON output globally for every test run by putting the following in your test helper:

Minitest::JsonApi.enable!

Development

This repository is a mirror of the public fossil repository hosted at fossil.abhij.it/repos/minitest-jsonapi

No pull requests are accepted through this repository. Email mail@abhij.it to discuss features.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 09 Sep 2022

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