lib/obscenity/rspec_matcher.rb in obscenity-1.0.1 vs lib/obscenity/rspec_matcher.rb in obscenity-1.0.2
- old
+ new
@@ -1,5 +1,7 @@
-RSpec::Matchers.define :be_profane do |expected|
- match do |actual|
- Obscenity.profane?(actual) == expected
+if defined?(RSpec::Matchers)
+ RSpec::Matchers.define :be_profane do |expected|
+ match do |actual|
+ Obscenity.profane?(actual) == expected
+ end
end
end