Skip to content
Uses ruby_scribe to convert your Test::Unit (+ shoulda) tests into RSpecs
Latest commit fc1b6a3 Oct 6, 2013 @rubiety Merge pull request #4 from kirs/patch-1
Depend on activesupport >=3.0
Failed to load latest commit information.
bin Added a few more assertion handlers and configured emitter to not par… Oct 11, 2011
spec Merge pull request #3 from iangreenleaf/more_transforms Nov 12, 2011
.gitignore Updated README with better documentation. Oct 11, 2011
.rspec Added rspec options file. Oct 21, 2010
.travis.yml Added travis-ci. Apr 1, 2012
Gemfile Added Gemfile pointing to gem spec. Sep 8, 2011
Gemfile.lock Added rake to dependencies and bumped ruby_transform dependency due t… Apr 1, 2012
LICENSE Initial gem with some scaffolding. Oct 19, 2010
Rakefile Added rake to dependencies and bumped ruby_transform dependency due t… Apr 2, 2012
rspecify.gemspec Depend on activesupport >=3.0 Oct 6, 2013


Build Status


Converting your tests from Test::Unit to RSpec is a drag when done by hand. This utility intelligently converts them to get you (hopefully) 90% of the way there.


NOTE: This gem is not essentially unusable and is being continually worked on - more of a proof of concept for now.

Command-Line Usage

The gem comes with a thor task that you can use to print out a converted version of any Ruby file containing Test::Unit Code.

$ rspecify cat test_project.rb

API Usage

This is built on the tree-walking base class RubyTransform::Transformer from the ruby_transform project. The principal transform, which is a composite of other more granular transforms, is +RSpecify::Transformer+. Here's how it can be used in conjunction with ruby_parser:

sexp =
sexp =

emitter =
emitter.methods_without_parenthesis += ["it", "describe", "context", "should", "should_not"]

Supported Test::Unit Assertion Transforms:

  • assert_equals

  • assert_not_equals

  • assert_not_nil


Original (Test::Unit):

class MyClass < ActiveSupport::TestCase
  def test_should_be_one
    assert_equals something, 1

  def test_should_not_be_one
    assert_not_equals something, 1

  def test_should_not_be_nil
    assert_not_nil something

Transformed (RSpec):

describe MyClass do
  it "should be one" do
    something.should == 1

  it "should not be one" do
    something.should_not == 1

  it "should not be nil" do
    something.should_not be_nil
Something went wrong with that request. Please try again.