spec/unit/mongoid_spec.rb in mongoid-0.10.3 vs spec/unit/mongoid_spec.rb in mongoid-0.10.4
- old
+ new
@@ -1,16 +1,18 @@
require "spec_helper"
describe Mongoid do
- describe ".database=" do
+ describe ".method_missing" do
- context "when object provided is not a Mongo::DB" do
+ before do
+ @config = mock
+ Mongoid::Config.expects(:instance).returns(@config)
+ end
- it "raises an error" do
- lambda { Mongoid.database = "Test" }.should raise_error
- end
-
+ it "delegates all calls to the config singleton" do
+ @config.expects(:raise_not_found_error=).with(false)
+ Mongoid.raise_not_found_error = false
end
end
end