Created
April 15, 2009 20:46
-
-
Save dchelimsky/96016 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
# doesn't work for everything - just a proof of concept | |
module Expect | |
def expect(actual, matcher) | |
unless matcher.matches?(actual) | |
raise Spec::Expectations::ExpectationNotMetError.new(matcher.failure_message_for_should) | |
end | |
end | |
end | |
Rspec.configure do |config| | |
config.include(Expect) | |
end | |
module Rspec::Matchers | |
alias_method :eq, :equal | |
end | |
describe 5 do | |
it "equals 5" do | |
expect 5, eq(5) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment