Class: RiotMongoMapper::HasPluginAssertion

Inherits:
Riot::AssertionMacro
  • Object
show all
Defined in:
lib/riot-mongo_mapper/has_plugin.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(model, plugin) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/riot-mongo_mapper/has_plugin.rb', line 5

def evaluate(model, plugin)
  assert = model.respond_to?(:plugins) ? model.plugins.include?(plugin) : model.class.plugins.include?(plugin)
  if assert
    pass("#{model} has plugin #{plugin.inspect}")
  else
    fail("expected #{model} to have plugin #{plugin.inspect}")
  end
end