Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created February 21, 2013 18:49
Show Gist options
  • Select an option

  • Save jimweirich/5007071 to your computer and use it in GitHub Desktop.

Select an option

Save jimweirich/5007071 to your computer and use it in GitHub Desktop.
RSpec Bad Triangle Matcher
module RSpec::Matchers
matcher :be_a_bad_triangle do |expected|
match do |sides|
begin
TriangleClassifier.new.classify(*sides)
false
rescue ArgumentError => ex
true
end
end
end
end
@georgeu2000
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment