Created
September 30, 2008 21:30
-
-
Save jasonroelofs/13965 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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