Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 25f7f79

Browse files
committed
Merge pull request tjackiw#6 from MichaelWhi/patch-1
only defines "be_profane" if RSpec is loaded
2 parents b2d2485 + 7c92847 commit 25f7f79

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: lib/obscenity/rspec_matcher.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
RSpec::Matchers.define :be_profane do |expected|
2-
match do |actual|
3-
Obscenity.profane?(actual) == expected
1+
if defined?(RSpec::Matchers)
2+
RSpec::Matchers.define :be_profane do |expected|
3+
match do |actual|
4+
Obscenity.profane?(actual) == expected
5+
end
46
end
57
end

0 commit comments

Comments
 (0)