Permalink
Browse files

Adds a very simple rspec style matcher

  • Loading branch information...
1 parent dcc1ce1 commit 386239cbce0bf21f79ae282d1a6a97e4d66046fe @Fitzsimmons committed Feb 29, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/unification_assertion.rb
View
9 lib/unification_assertion.rb
@@ -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.