spec/sequel/fixture_spec.rb in sequel-fixture-0.0.2 vs spec/sequel/fixture_spec.rb in sequel-fixture-0.0.3
- old
+ new
@@ -84,9 +84,21 @@
Fast.dir.remove! :test
end
end
end
+ describe "#force_checked!" do
+ it "check should return true and should not call [] in the passed database" do
+ database = stub 'database'
+ database.should_not_receive :[]
+
+ Sequel::Fixture.any_instance.stub :load
+ fix = Sequel::Fixture.new :anything, database, false
+ fix.force_checked!.should === true
+ fix.check.should === true
+ end
+ end
+
describe "#[]" do
context "a valid fixture has been loaded" do
before do
Fast.file.write "test/fixtures/test/users.yaml", "john: { name: John, last_name: Wayne }"
Fast.file.write "test/fixtures/test/actions.yaml", "walk: { user_id: 1, action: Walks }"