sequel-fixture 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Sequel
2
2
  class Fixture
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -54,6 +54,11 @@ module Sequel
54
54
  return super
55
55
  end
56
56
 
57
+ # Forces the check to pass. Dangerous!
58
+ def force_checked!
59
+ @checked = true
60
+ end
61
+
57
62
  # Assures that the tables are empty before proceeding
58
63
  def check
59
64
  return @checked if @checked # If already checked, it's alright
@@ -86,6 +86,18 @@ describe Sequel::Fixture do
86
86
  end
87
87
  end
88
88
 
89
+ describe "#force_checked!" do
90
+ it "check should return true and should not call [] in the passed database" do
91
+ database = stub 'database'
92
+ database.should_not_receive :[]
93
+
94
+ Sequel::Fixture.any_instance.stub :load
95
+ fix = Sequel::Fixture.new :anything, database, false
96
+ fix.force_checked!.should === true
97
+ fix.check.should === true
98
+ end
99
+ end
100
+
89
101
  describe "#[]" do
90
102
  context "a valid fixture has been loaded" do
91
103
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-fixture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: