Method: Object#conflicts_with
- Defined in:
- lib/mspec/guards/conflict.rb
#conflicts_with(*modules) ⇒ Object
In some cases, libraries will modify another Ruby method’s behavior. The specs for the method’s behavior will then fail if that library is loaded. This guard will not run if any of the specified constants exist in Object.constants.
16 17 18 19 20 21 22 |
# File 'lib/mspec/guards/conflict.rb', line 16 def conflicts_with(*modules) g = ConflictsGuard.new(*modules) g.name = :conflicts_with yield if g.yield? true ensure g.unregister end |