Sha256: fa394e4d1b52dcf41900ee169a1b45e34ef5c79d9bf5c5fda90581316cdbf707
Contents?: true
Size: 829 Bytes
Versions: 14
Compression:
Stored size: 829 Bytes
Contents
require 'test_helper' module MyPlugin module ClassMethods def class_foo 'class_foo' end end module InstanceMethods def instance_foo 'instance_foo' end end end class PluginsTest < Test::Unit::TestCase context "plugin" do setup do @document = Class.new do extend MongoMapper::Plugins plugin MyPlugin end end should "include instance methods" do @document.new.instance_foo.should == 'instance_foo' end should "extend class methods" do @document.class_foo.should == 'class_foo' end should "default plugins to empty array" do Class.new { extend MongoMapper::Plugins }.plugins.should == [] end should "add plugin to plugins" do @document.plugins.should include(MyPlugin) end end end
Version data entries
14 entries across 14 versions & 2 rubygems