lib/remarkable/matchers.rb in remarkable-3.1.3 vs lib/remarkable/matchers.rb in remarkable-3.1.4
- old
+ new
@@ -16,11 +16,12 @@
else
raise ArgumentError, "You haven't supplied the target to include_matchers! and RSpec is not loaded, so we cannot infer one."
end
end
- target.send :extend, Remarkable::Pending
- target.send :extend, Remarkable::Macros
+ metaclass = (class << target; self; end)
+ target.send :extend, Remarkable::Pending unless metaclass.ancestors.include?(Remarkable::Pending)
+ target.send :extend, Remarkable::Macros unless metaclass.ancestors.include?(Remarkable::Macros)
if defined?(base::Matchers)
target.send :include, base::Matchers
Remarkable::Matchers.send :extend, base::Matchers