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

minitest-bonus-assertions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minitest-bonus-assertions

  • 3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= minitest-bonus-assertions

code :: https://github.com/halostatue/minitest-bonus-assertions bugs :: https://github.com/halostatue/minitest-bonus-assertions/issues continuous integration :: {}[https://travis-ci.org/halostatue/minitest-bonus-assertions]

== Description

Bonus assertions for {Minitest}[https://github.com/seattlerb/minitest], providing assertions I use frequently, supporting only Ruby 2.0 or better.

== Features

New assertions:

  • +assert_false+: requires that the value be exactly +false+. (+must_be_false+)
  • +assert_true+: requires that the value be exactly +true+. (+must_be_true+)
  • +assert_between+: requires that the value be strictly between the low and high values provided, or the range (this test is boundary-exclusive). (+must_be_between+)
  • +assert_has_keys+/+refute_missing_keys+: requires that the object contains all of the keys expected. (+must_have_keys+)
  • +assert_missing_keys+/+refute_has_keys+: requires that the object not have any of the keys expected. (+must_not_have_keys+)
  • +assert_raises_with_message+: requires that the exception raised in the provided block has a specific message (tested with +assert_equal+). (+must_raise_with_message+)
  • +assert_set_equal+: requires that the actual enumerable have the same values as the expected enumerable, without regard to order and ignoring duplicate values. (+must_equal_set+)
  • +refute_set_equal+: requires that the actual enumerable not have the same values as the expected enumerable. (+must_not_equal_set+)
  • +assert_result_equal+: requires that the actual is equal to the result of evaluating an expression.

I am also providing the Minitest-tester code I use as something that can be required by other developers. This should only be used to test Minitest assertions and extensions. For more information on Minitest::AssertionTests, see its documentation.

== Background

minitest-bonus-assertions started life as a patch to Ben Somer’s {minitest-extra-assertions}[https://github.com/bensomers/minitest-extra-assertions]. There were some nice assertions included, but there were other changes that needed to be made to bring it up to support Minitest 5. There was also an override to the default +assert_match+ implementation meant to ease the transition from Test::Unit (the main reason he wrote this assertion plugin for Minitest in the first place). I do not believe this is sensible five major versions into Minitest: I removed it. Ben did not feel comfortable making this particular change, so I felt that the best way to provide the original assertions and my new assertions—without the +assert_match+ override—was to fork this as a new project. I am indebted to Ben and his contributors for writing these assertions in the first place.

== Install

Add it to your Gemfile:

gem 'minitest-bonus-assertions', '~> 1.1'

Or manually install:

% gem install minitest-bonus-assertions

== minitest-bonus-assertions Semantic Versioning

minitest-bonus-assertions uses a {Semantic Versioning}[http://semver.org/] scheme with one change:

  • When PATCH is zero (+0+), it will be omitted from version references.

:include: Code-of-Conduct.rdoc

:include: Contributing.rdoc

:include: Licence.rdoc

FAQs

Package last updated on 26 Apr 2017

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