public
Description: BDD that talks to domain experts first and code second
Home | Edit | New

Using Test::Unit

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 prior to 0.2.3.2:

require 'test/unit/assertions'

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

or in version 0.2.3.2 and later:

require 'test/unit/assertions'

World(Test::Unit::Assertions)

You can see a full example under the examples

Last edited by allcaps, Mon May 18 04:44:59 -0700 2009
Home | Edit | New
Versions: