Thursday, December 01, 2011

`test': unknown command 't' (ArgumentError)

To write tests using Test::Unit new syntax :

test "truth" do
  assert true
end

1. gem install test-unit
2. Code:

require 'rubygems'
gem 'test-unit'
require 'test/unit'


class ExampleTest < Test::Unit::TestCase
  def test_truth
    assert true
  end
 
  test "truth" do
    assert true
  end
end


3. Run: ruby example_test This will work on ruby-1.9.3-p0.

Reference:  Test::Unit and MiniTest with different Ruby versions