Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'test/unit'
class ShouldTest < Test::Unit::TestCase
def self.should(behave, &block)
mname = "test_should_#{behave}"
if block
define_method mname, &block
else
define_method mname do
flunk "#{self.class.name.sub(/Test$/,'')} should #{behave}"
end
end
end
should "give me a true!" do
assert true
end
should "fail badly and show in stdout" do
assert false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.