Created
February 8, 2012 09:04
-
-
Save nahi/1767002 to your computer and use it in GitHub Desktop.
This file contains 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
def expect | |
begin | |
yield | |
rescue Exception => excn | |
o = Struct.new(:excn).new(excn) | |
def o.to(arg) | |
arg.call(excn) | |
end | |
o | |
end | |
end | |
def something | |
raise | |
end | |
def raise_error(expected) | |
Proc.new { |actual| | |
yield [expected, actual] | |
} | |
end | |
expect { something }.to raise_error(NotImplementedError) { |e| p e } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment