Skip to content
oriolgual edited this page May 16, 2011 · 9 revisions

You can also use MiniTest assert methods by defining your own World block:

require 'mini/test'

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

If it doesn’t work, try this one:

require 'minitest/unit'

World do
  extend Mini::Test::Assertions
end

Or

require 'minitest/unit'
World(MiniTest::Assertions)

Also, if you wanted to use MiniTest::Spec, the snippet would look like this:

require 'minitest/spec'
World(MiniTest::Assertions)
MiniTest::Spec.new(nil)

Also see the minitest cheat sheet here

Clone this wiki locally