Skip to content

Commit

Permalink
Adds a very simple rspec style matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Fitzsimmons committed Feb 29, 2012
1 parent dcc1ce1 commit 386239c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/unification_assertion.rb
Expand Up @@ -143,3 +143,12 @@ def assert_unifiable(a, b, message = "", options = {}, &block)
end
end

if defined?(RSpec)
RSpec::Matchers.define :unify do |expected|
match do |actual|
UnificationAssertion.unify([[actual, expected]]) do |a, b|
a.should == b
end
end
end
end

0 comments on commit 386239c

Please sign in to comment.