spec/candy/crunch_spec.rb in candy-0.2.4 vs spec/candy/crunch_spec.rb in candy-0.2.5
- old
+ new
@@ -93,11 +93,11 @@
PeanutBrittle.db.name.should == 'candy'
end
it "clears the collection when you set it" do
PeanutBrittle.db = 'candy_test'
- PeanutBrittle.collection.name.should == PeanutBrittle.name
+ PeanutBrittle.collection.name.should == 'PeanutBrittle'
PeanutBrittle.db = nil
PeanutBrittle.instance_variable_get(:@collection).should be_nil
end
it "takes a username and password if you provide them globally" do
@@ -149,10 +149,10 @@
PeanutBrittle.collection = 'bleh'
PeanutBrittle.collection.name.should == 'bleh'
end
it "defaults to the class name" do
- PeanutBrittle.collection.name.should == PeanutBrittle.name
+ PeanutBrittle.collection.name.should == 'PeanutBrittle'
end
it "throws an exception if you give it a type it can't recognize" do
lambda{PeanutBrittle.collection = 17.3}.should raise_error(Candy::ConnectionError, "The collection attribute needs a Mongo::Collection object or a name string.")
end