Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Use RSpec and Shoulda matchers in Test::Unit

branch: develop

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 .yardopts
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Rakefile
Octocat-spinner-32 matchbox.gemspec

matchbox - use RSpec and Shoulda matchers in Test::Unit StillMaintained Status Build Status

Matchbox allows you to use RSpec and Shoulda matchers as regular, old Test::Unit assertions.


Without bundler:

gem install matchbox

With bundler:

gem 'matchbox'


Just include the RSpec matchers into the TestCase and they can be used as seen below. This example uses methods found in shoulda-matchers.

class PostTest < Test::Unit::TestCase
  def test_active_record_relations
    post =
    assert_accepts belong_to(:topic), post

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, but do not mess with the Rakefile. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.
  • Send me a pull request. Bonus points for git flow feature branches.



Matchbox is licensed under the MIT License. See LICENSE for details.

Something went wrong with that request. Please try again.