Skip to content
jbpros edited this page May 13, 2011 · 7 revisions

Don’t like RSpec’s should methods for assertions? No problem, we won’t force you to. You can use the familiar Test::Unit assert methods by defining your own World block in versions 0.2.3.2 and later:

require 'test/unit/assertions'

World(Test::Unit::Assertions)

or in version prior to 0.2.3.2:

require 'test/unit/assertions'

World do |world|
  world.extend(Test::Unit::Assertions)
  world
end

You can see a full example under the examples

Clone this wiki locally