Socket
Book a DemoInstallSign in
Socket

rspec2minitest

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspec2minitest

0.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Gem Version Dependency Status Code Climate

RSpec2MiniTest

Provides a generic factory to automatically convert the RSpec matchers of your favorite gems into assertions and expectations for MiniTest::Unit and MiniTest::Spec. It is a generalization of Jared Ning's capybara_minitest_spec.

Installation

# Gemfile
gem 'rspec2minitest'

Integrations

Capybara

To create assertions / expectations from all Capybara RSpec matchers add to your test_helper:

require 'rspec2minitest/capybara'

For the have_text matcher you can then use:

# Unit
assert_page_has_text(page, text)
refute_page_has_text(page, text)

# Spec
it { must_have_text(text) }
it { wont_have_text(text) }

For all matchers see Capybara/RSpecMatchers

This is exactly what the capybara_minitest_spec gem does. If Capybara matchers are the only ones you need to convert, I recommend using that gem.

Paperclip

# test_helper
require 'rspec2minitest/paperclip'

The have_attachment matcher gets converted to assert_model_has_attachment and must_have_attachment and their negative counterparts.

For all matchers see Paperclip::Shoulda::Matchers

Custom integrations

You can use the API of rspec2minitest to easily create your own integrations within your test_helper. require 'rspec2minitest' provides you with an RSpec2MiniTest module that provides an add_matcher function to convert single matchers and an add_matchers function to convert all public instance methods of a given module.

Have a look at the integrations in lib/rspec2minitest for examples and do not forget to issue a pull request to add lib/rspec2minitest/#{gemname}.rb to the rspec2minitest spec. :)

FAQs

Package last updated on 07 Nov 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.