database_cleaner 1.6.2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile.lock +3 -3
  3. data/History.rdoc +23 -0
  4. data/README.markdown +24 -1
  5. data/VERSION.yml +2 -2
  6. data/lib/database_cleaner.rb +6 -2
  7. data/lib/database_cleaner/active_record/base.rb +1 -1
  8. data/lib/database_cleaner/active_record/deletion.rb +9 -7
  9. data/lib/database_cleaner/base.rb +2 -0
  10. data/lib/database_cleaner/safeguard.rb +72 -0
  11. metadata +6 -86
  12. data/examples/Gemfile +0 -1
  13. data/examples/Gemfile.lock +0 -1
  14. data/examples/config/database.yml.example +0 -8
  15. data/examples/config/redis.yml +0 -8
  16. data/examples/db/sqlite_databases_go_here +0 -0
  17. data/examples/features/example.feature +0 -11
  18. data/examples/features/example_multiple_db.feature +0 -23
  19. data/examples/features/example_multiple_orm.feature +0 -22
  20. data/examples/features/step_definitions/activerecord_steps.rb +0 -31
  21. data/examples/features/step_definitions/couchpotato_steps.rb +0 -31
  22. data/examples/features/step_definitions/datamapper_steps.rb +0 -37
  23. data/examples/features/step_definitions/mongoid_steps.rb +0 -23
  24. data/examples/features/step_definitions/mongomapper_steps.rb +0 -31
  25. data/examples/features/step_definitions/neo4j_steps.rb +0 -23
  26. data/examples/features/step_definitions/ohm_steps.rb +0 -31
  27. data/examples/features/step_definitions/redis_steps.rb +0 -31
  28. data/examples/features/step_definitions/translation_steps.rb +0 -55
  29. data/examples/features/support/env.rb +0 -61
  30. data/examples/lib/activerecord_models.rb +0 -41
  31. data/examples/lib/couchpotato_models.rb +0 -61
  32. data/examples/lib/datamapper_models.rb +0 -50
  33. data/examples/lib/mongoid_models.rb +0 -44
  34. data/examples/lib/mongomapper_models.rb +0 -51
  35. data/examples/lib/neo4j_models.rb +0 -17
  36. data/examples/lib/ohm_models.rb +0 -43
  37. data/examples/lib/redis_models.rb +0 -65
  38. data/examples/lib/sequel_models.rb +0 -9
  39. data/features/cleaning.feature +0 -30
  40. data/features/cleaning_default_strategy.feature +0 -23
  41. data/features/cleaning_multiple_dbs.feature +0 -22
  42. data/features/cleaning_multiple_orms.feature +0 -67
  43. data/features/step_definitions/database_cleaner_steps.rb +0 -33
  44. data/features/support/env.rb +0 -4
  45. data/features/support/feature_runner.rb +0 -39
  46. data/spec/database_cleaner/active_record/base_spec.rb +0 -188
  47. data/spec/database_cleaner/active_record/transaction_spec.rb +0 -176
  48. data/spec/database_cleaner/active_record/truncation/mysql2_spec.rb +0 -38
  49. data/spec/database_cleaner/active_record/truncation/mysql_spec.rb +0 -38
  50. data/spec/database_cleaner/active_record/truncation/postgresql_spec.rb +0 -75
  51. data/spec/database_cleaner/active_record/truncation/shared_fast_truncation.rb +0 -40
  52. data/spec/database_cleaner/active_record/truncation/sqlite3_spec.rb +0 -40
  53. data/spec/database_cleaner/active_record/truncation_spec.rb +0 -180
  54. data/spec/database_cleaner/base_spec.rb +0 -617
  55. data/spec/database_cleaner/configuration_spec.rb +0 -345
  56. data/spec/database_cleaner/couch_potato/truncation_spec.rb +0 -41
  57. data/spec/database_cleaner/data_mapper/base_spec.rb +0 -30
  58. data/spec/database_cleaner/data_mapper/transaction_spec.rb +0 -23
  59. data/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb +0 -41
  60. data/spec/database_cleaner/data_mapper/truncation_spec.rb +0 -11
  61. data/spec/database_cleaner/generic/base_spec.rb +0 -61
  62. data/spec/database_cleaner/generic/truncation_spec.rb +0 -118
  63. data/spec/database_cleaner/mongo/mongo_examples.rb +0 -26
  64. data/spec/database_cleaner/mongo/truncation_spec.rb +0 -72
  65. data/spec/database_cleaner/mongo_mapper/base_spec.rb +0 -33
  66. data/spec/database_cleaner/mongo_mapper/mongo_examples.rb +0 -8
  67. data/spec/database_cleaner/mongo_mapper/truncation_spec.rb +0 -74
  68. data/spec/database_cleaner/moped/moped_examples.rb +0 -32
  69. data/spec/database_cleaner/moped/truncation_spec.rb +0 -80
  70. data/spec/database_cleaner/neo4j/base_spec.rb +0 -43
  71. data/spec/database_cleaner/neo4j/transaction_spec.rb +0 -25
  72. data/spec/database_cleaner/null_strategy_spec.rb +0 -28
  73. data/spec/database_cleaner/ohm/truncation_spec.rb +0 -70
  74. data/spec/database_cleaner/redis/base_spec.rb +0 -43
  75. data/spec/database_cleaner/redis/truncation_spec.rb +0 -63
  76. data/spec/database_cleaner/sequel/base_spec.rb +0 -32
  77. data/spec/database_cleaner/sequel/deletion_spec.rb +0 -58
  78. data/spec/database_cleaner/sequel/transaction_spec.rb +0 -21
  79. data/spec/database_cleaner/sequel/truncation/sqlite3_spec.rb +0 -0
  80. data/spec/database_cleaner/sequel/truncation_spec.rb +0 -182
  81. data/spec/database_cleaner/shared_strategy.rb +0 -15
  82. data/spec/rcov.opts +0 -1
  83. data/spec/spec_helper.rb +0 -21
  84. data/spec/support/active_record/database_setup.rb +0 -6
  85. data/spec/support/active_record/migrations/20150101010000_create_users.rb +0 -14
  86. data/spec/support/active_record/migrations/20150101020000_create_agents.rb +0 -14
  87. data/spec/support/active_record/mysql2_setup.rb +0 -39
  88. data/spec/support/active_record/mysql_setup.rb +0 -38
  89. data/spec/support/active_record/postgresql_setup.rb +0 -48
  90. data/spec/support/active_record/schema_setup.rb +0 -17
  91. data/spec/support/active_record/sqlite3_setup.rb +0 -40
  92. data/spec/support/data_mapper/schema_setup.rb +0 -15
  93. data/spec/support/data_mapper/sqlite3_setup.rb +0 -39
@@ -1,43 +0,0 @@
1
- require 'spec_helper'
2
- require 'database_cleaner/neo4j/base'
3
- require 'database_cleaner/shared_strategy'
4
-
5
- module DatabaseCleaner
6
- describe Neo4j do
7
- it { should respond_to(:available_strategies) }
8
- end
9
-
10
- module Neo4j
11
- class ExampleStrategy
12
- include ::DatabaseCleaner::Neo4j::Base
13
- end
14
-
15
- describe ExampleStrategy do
16
-
17
- it_should_behave_like "a generic strategy"
18
- it { should respond_to(:db) }
19
- it { should respond_to(:db=) }
20
-
21
- it "should store my describe db" do
22
- db_conf = {:connection => {:type => :server_db, :path => 'http://localhost:7474'}}
23
- subject.db = db_conf
24
- subject.db.should eq db_conf
25
- end
26
-
27
- it "should respect additional connection parameters" do
28
- db_conf = {:type => :server_db, :path => 'http://localhost:7474', basic_auth: {username: 'user', password: 'pass'}}
29
- subject.db = db_conf
30
- stub_const("Neo4j::Session", double()).should_receive(:open).with(:server_db, 'http://localhost:7474', {basic_auth: {username: 'user', password: 'pass'}}) { true }
31
- subject.start
32
- end
33
-
34
- it "should default to nil" do
35
- subject.db.should be_nil
36
- end
37
-
38
- it "should return default configuration" do
39
- subject.database.should eq(:type => :server_db, :path => 'http://localhost:7475/')
40
- end
41
- end
42
- end
43
- end
@@ -1,25 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
- require 'neo4j-core'
3
- require 'database_cleaner/neo4j/transaction'
4
-
5
- module DatabaseCleaner
6
- module Neo4j
7
-
8
- describe Transaction do
9
- before(:all) do
10
- DatabaseCleaner[:neo4j, :connection => {:type => :server_db, :path => 'http://localhost:7474'}]
11
- end
12
-
13
- it_should_behave_like "a generic strategy"
14
- it_should_behave_like "a generic transaction strategy"
15
-
16
- describe "start" do
17
- it "should start a transaction"
18
- end
19
-
20
- describe "clean" do
21
- it "should finish a transaction"
22
- end
23
- end
24
- end
25
- end
@@ -1,28 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module DatabaseCleaner
4
- describe NullStrategy do
5
- it 'responds to .start' do
6
- expect { NullStrategy.start }.not_to raise_error(NoMethodError)
7
- end
8
-
9
- it 'responds to .clean' do
10
- expect { NullStrategy.clean }.not_to raise_error(NoMethodError)
11
- end
12
-
13
- describe '.cleaning' do
14
- it 'fails without a block' do
15
- expect { NullStrategy.cleaning }.to raise_error(LocalJumpError)
16
- end
17
-
18
- it 'no-ops with a block' do
19
- effect = double
20
- expect(effect).to receive(:occur).once
21
-
22
- NullStrategy.cleaning do
23
- effect.occur
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,70 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
- require 'ohm'
3
- require 'database_cleaner/ohm/truncation'
4
-
5
- module DatabaseCleaner
6
- module Ohm
7
-
8
- class Widget < ::Ohm::Model
9
- attribute :name
10
- end
11
-
12
- class Gadget < ::Ohm::Model
13
- attribute :name
14
- end
15
-
16
- describe Truncation do
17
- before(:all) do
18
- config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
19
- ::Ohm.connect :url => config['test']['url']
20
- @redis = ::Ohm.redis
21
- end
22
-
23
- before(:each) do
24
- @redis.flushdb
25
- end
26
-
27
- it "should flush the database" do
28
- Truncation.new.clean
29
- end
30
-
31
- def create_widget(attrs={})
32
- Widget.new({:name => 'some widget'}.merge(attrs)).save
33
- end
34
-
35
- def create_gadget(attrs={})
36
- Gadget.new({:name => 'some gadget'}.merge(attrs)).save
37
- end
38
-
39
- it "truncates all keys by default" do
40
- create_widget
41
- create_gadget
42
- @redis.keys.size.should eq 6
43
- Truncation.new.clean
44
- @redis.keys.size.should eq 0
45
- end
46
-
47
- context "when keys are provided to the :only option" do
48
- it "only truncates the specified keys" do
49
- create_widget
50
- create_gadget
51
- @redis.keys.size.should eq 6
52
- Truncation.new(:only => ['*Widget*']).clean
53
- @redis.keys.size.should eq 3
54
- @redis.get('DatabaseCleaner::Ohm::Gadget:id').should eq '1'
55
- end
56
- end
57
-
58
- context "when keys are provided to the :except option" do
59
- it "truncates all but the specified keys" do
60
- create_widget
61
- create_gadget
62
- @redis.keys.size.should eq 6
63
- Truncation.new(:except => ['*Widget*']).clean
64
- @redis.keys.size.should eq 3
65
- @redis.get('DatabaseCleaner::Ohm::Widget:id').should eq '1'
66
- end
67
- end
68
- end
69
- end
70
- end
@@ -1,43 +0,0 @@
1
- require 'spec_helper'
2
- require 'redis'
3
- require 'database_cleaner/redis/base'
4
- require 'database_cleaner/shared_strategy'
5
-
6
- module DatabaseCleaner
7
- describe Redis do
8
- it { should respond_to(:available_strategies) }
9
- end
10
-
11
- module Redis
12
- class ExampleStrategy
13
- include ::DatabaseCleaner::Redis::Base
14
- end
15
-
16
- describe ExampleStrategy do
17
-
18
- it_should_behave_like "a generic strategy"
19
- it { should respond_to(:db) }
20
- it { should respond_to(:db=) }
21
-
22
- context "when passing url" do
23
- it "should store my describe db" do
24
- url = 'redis://localhost:6379/2'
25
- subject.db = 'redis://localhost:6379/2'
26
- subject.db.should eq url
27
- end
28
- end
29
-
30
- context "when passing connection" do
31
- it "should store my describe db" do
32
- connection = ::Redis.new :url => 'redis://localhost:6379/2'
33
- subject.db = connection
34
- subject.db.should eq connection
35
- end
36
- end
37
-
38
- it "should default to :default" do
39
- subject.db.should eq :default
40
- end
41
- end
42
- end
43
- end
@@ -1,63 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
- require 'redis'
3
- require 'database_cleaner/redis/truncation'
4
-
5
-
6
- module DatabaseCleaner
7
- module Redis
8
-
9
- describe Truncation do
10
- before(:all) do
11
- config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
12
- @redis = ::Redis.new :url => config['test']['url']
13
- end
14
-
15
- before(:each) do
16
- @redis.flushdb
17
- end
18
-
19
- it "should flush the database" do
20
- Truncation.new.clean
21
- end
22
-
23
- def create_widget(attrs={})
24
- @redis.set 'Widget', 1
25
- end
26
-
27
- def create_gadget(attrs={})
28
- @redis.set 'Gadget', 1
29
- end
30
-
31
- it "truncates all keys by default" do
32
- create_widget
33
- create_gadget
34
- @redis.keys.size.should eq 2
35
- Truncation.new.clean
36
- @redis.keys.size.should eq 0
37
- end
38
-
39
- context "when keys are provided to the :only option" do
40
- it "only truncates the specified keys" do
41
- create_widget
42
- create_gadget
43
- @redis.keys.size.should eq 2
44
- Truncation.new(:only => ['Widge*']).clean
45
- @redis.keys.size.should eq 1
46
- @redis.get('Gadget').should eq '1'
47
- end
48
- end
49
-
50
- context "when keys are provided to the :except option" do
51
- it "truncates all but the specified keys" do
52
- create_widget
53
- create_gadget
54
- @redis.keys.size.should eq 2
55
- Truncation.new(:except => ['Widg*']).clean
56
- @redis.keys.size.should eq 1
57
- @redis.get('Widget').should eq '1'
58
- end
59
- end
60
- end
61
- end
62
- end
63
-
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
- require 'database_cleaner/sequel/base'
3
- require 'database_cleaner/shared_strategy'
4
- require 'sequel'
5
-
6
- module DatabaseCleaner
7
- describe Sequel do
8
- it { should respond_to(:available_strategies) }
9
- end
10
-
11
- module Sequel
12
- class ExampleStrategy
13
- include ::DatabaseCleaner::Sequel::Base
14
- end
15
-
16
- describe ExampleStrategy do
17
- it_should_behave_like "a generic strategy"
18
- it { should respond_to(:db) }
19
- it { should respond_to(:db=) }
20
-
21
- it "should store my desired db" do
22
- subject.db = :my_db
23
- subject.db.should eq :my_db
24
- end
25
-
26
- it "should default to :default" do
27
- pending "I figure out how to use Sequel and write some real tests for it..."
28
- subject.db.should eq :default
29
- end
30
- end
31
- end
32
- end
@@ -1,58 +0,0 @@
1
- require 'spec_helper'
2
- require 'database_cleaner/sequel/deletion'
3
- require 'database_cleaner/shared_strategy'
4
- require 'sequel'
5
- require 'support/active_record/database_setup'
6
-
7
- module DatabaseCleaner
8
- module Sequel
9
- describe Deletion do
10
- it_should_behave_like "a generic strategy"
11
- end
12
-
13
- shared_examples 'a Sequel deletion strategy' do
14
- let(:deletion) do
15
- d = Deletion.new
16
- d.db = db
17
- d
18
- end
19
-
20
- context 'when several tables have data' do
21
- before(:each) do
22
- db.create_table!(:precious_stones) { primary_key :id }
23
- db.create_table!(:replaceable_trifles) { primary_key :id }
24
- db.create_table!(:worthless_junk) { primary_key :id }
25
-
26
- db[:precious_stones].insert
27
- db[:replaceable_trifles].insert
28
- db[:worthless_junk].insert
29
- end
30
-
31
- context 'by default' do
32
- it 'deletes all the tables' do
33
- d = Deletion.new
34
- d.db = db
35
- d.clean
36
-
37
- expect(db[:replaceable_trifles]).to have(0).rows
38
- expect(db[:worthless_junk]).to have(0).rows
39
- expect(db[:precious_stones]).to have(0).rows
40
- end
41
- end
42
- end
43
- end
44
-
45
- supported_configurations = [
46
- { :url => 'mysql:///', :connection_options => db_config['mysql'] },
47
- { :url => 'postgres:///', :connection_options => db_config['postgres'] }
48
- ]
49
-
50
- supported_configurations.each do |config|
51
- describe "Sequel deletion (using a #{config[:url]} connection)" do
52
- let(:db) { ::Sequel.connect(config[:url], config[:connection_options]) }
53
-
54
- it_behaves_like 'a Sequel deletion strategy'
55
- end
56
- end
57
- end
58
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
- require 'database_cleaner/sequel/transaction'
3
- require 'database_cleaner/shared_strategy'
4
- require 'sequel'
5
-
6
- module DatabaseCleaner
7
- module Sequel
8
- describe Transaction do
9
- it_should_behave_like "a generic strategy"
10
- it_should_behave_like "a generic transaction strategy"
11
-
12
- describe "start" do
13
- it "should start a transaction"
14
- end
15
-
16
- describe "clean" do
17
- it "should finish a transaction"
18
- end
19
- end
20
- end
21
- end
@@ -1,182 +0,0 @@
1
- require 'spec_helper'
2
- require 'database_cleaner/sequel/truncation'
3
- require 'database_cleaner/shared_strategy'
4
- require 'sequel'
5
-
6
- # XXX: use ActiveRecord's db_config (`db/config.yml`) for CI/dev convenience
7
- require 'support/active_record/database_setup'
8
-
9
- module DatabaseCleaner
10
- module Sequel
11
- describe Truncation do
12
- it_should_behave_like "a generic strategy"
13
- it_should_behave_like "a generic truncation strategy"
14
- end
15
-
16
- shared_examples 'a Sequel truncation strategy' do
17
-
18
- # XXX: it'd be really nice if Truncation accepted db: constructor parameter
19
- let(:truncation) do
20
- t = Truncation.new
21
- t.db = db
22
- t
23
- end
24
-
25
- context 'when several tables have data' do
26
- before(:each) do
27
- db.create_table!(:precious_stones) { primary_key :id }
28
- db.create_table!(:replaceable_trifles) { primary_key :id }
29
- db.create_table!(:worthless_junk) { primary_key :id }
30
-
31
- db[:precious_stones].insert
32
- db[:replaceable_trifles].insert
33
- db[:worthless_junk].insert
34
- end
35
- context 'by default' do
36
- it 'truncates all the tables' do
37
- t = Truncation.new
38
- t.db = db
39
- t.clean
40
-
41
- expect(db[:replaceable_trifles]).to have(0).rows
42
- expect(db[:worthless_junk]).to have(0).rows
43
- expect(db[:precious_stones]).to have(0).rows
44
- end
45
- end
46
- context 'when the Truncation is restricted to "only: [...]" some tables' do
47
- it 'truncates only the mentioned tables (and leaves the rest alone)' do
48
- t = Truncation.new(only: ['worthless_junk', 'replaceable_trifles'])
49
- t.db = db
50
- t.clean
51
-
52
- expect(db[:replaceable_trifles]).to have(0).rows
53
- expect(db[:worthless_junk]).to have(0).rows
54
- expect(db[:precious_stones]).to have(1).rows
55
- end
56
- end
57
- context 'when the Truncation is restricted to "except: [...]" some tables' do
58
- it 'leaves the mentioned tables alone (and truncates the rest)' do
59
- t = Truncation.new(except: ['precious_stones']) # XXX: Strings only, symbols are ignored
60
- t.db = db
61
- t.clean
62
-
63
- expect(db[:replaceable_trifles]).to be_empty
64
- expect(db[:worthless_junk]).to be_empty
65
- expect(db[:precious_stones]).to have(1).item
66
- end
67
- end
68
- end
69
- end
70
-
71
- shared_examples_for 'a truncation strategy without autoincrement resets' do
72
- it "leaves AUTO_INCREMENT index alone by default (BUG: it should be reset instead)" do
73
- # Jordan Hollinger made everything reset auto increment IDs
74
- # in commit 6a0104382647e5c06578aeac586c0333c8944492 so I'm pretty sure
75
- # everything is meant to reset by default.
76
- #
77
- # For Postgres, db[:mytable].truncate(restart: true) should work.
78
- # For SQLite, db[:sqlite_sequence].where(name: 'mytable').delete
79
-
80
- db.create_table!(:replaceable_trifles) { primary_key :id }
81
- table = db[:replaceable_trifles]
82
- 2.times { table.insert }
83
-
84
- truncation.clean
85
-
86
- id_after_clean = table.insert
87
- pending('the bug being fixed') do
88
- expect(id_after_clean).to eq 1
89
- end
90
- end
91
- # XXX: it'd be really nice if Truncation accepted db: constructor parameter
92
- let(:truncation) do
93
- t = Truncation.new
94
- t.db = db
95
- t
96
- end
97
- end
98
-
99
- shared_examples_for 'a truncation strategy that resets autoincrement keys by default' do
100
- it "resets AUTO_INCREMENT primary keys" do
101
- db.create_table!(:replaceable_trifles) { primary_key :id }
102
- table = db[:replaceable_trifles]
103
- 2.times { table.insert }
104
-
105
- truncation.clean
106
-
107
- id_after_clean = table.insert
108
- expect(id_after_clean).to eq 1
109
- end
110
-
111
- # XXX: it'd be really nice if Truncation accepted db: constructor parameter
112
- let(:truncation) do
113
- t = Truncation.new
114
- t.db = db
115
- t
116
- end
117
- end
118
-
119
- half_supported_configurations = [
120
- {url: 'sqlite:///', connection_options: db_config['sqlite3']},
121
- {url: 'postgres:///', connection_options: db_config['postgres']},
122
- ]
123
- supported_configurations = [
124
- {url: 'mysql:///', connection_options: db_config['mysql']},
125
- {url: 'mysql2:///', connection_options: db_config['mysql2']}
126
- ]
127
- supported_configurations.each do |config|
128
- describe "Sequel truncation (using a #{config[:url]} connection)" do
129
- let(:db) { ::Sequel.connect(config[:url], config[:connection_options]) }
130
-
131
- it_behaves_like 'a Sequel truncation strategy'
132
- it_behaves_like 'a truncation strategy that resets autoincrement keys by default'
133
-
134
- describe '#pre_count?' do
135
- subject { Truncation.new.tap { |t| t.db = db } }
136
-
137
- its(:pre_count?) { should eq false }
138
-
139
- it 'should return true if @reset_id is set and non false or nil' do
140
- subject.instance_variable_set(:"@pre_count", true)
141
- subject.send(:pre_count?).should eq true
142
- end
143
-
144
- it 'should return false if @reset_id is set to false' do
145
- subject.instance_variable_set(:"@pre_count", false)
146
- subject.send(:pre_count?).should eq false
147
- end
148
- end
149
-
150
- describe "relying on #pre_count_truncate_tables if asked to" do
151
- subject { Truncation.new.tap { |t| t.db = db } }
152
-
153
- it "should rely on #pre_count_truncate_tables if #pre_count? returns true" do
154
- subject.instance_variable_set(:"@pre_count", true)
155
-
156
- subject.should_not_receive(:truncate_tables)
157
- subject.should_receive(:pre_count_truncate_tables)
158
-
159
- subject.clean
160
- end
161
-
162
- it "should not rely on #pre_count_truncate_tables if #pre_count? return false" do
163
- subject.instance_variable_set(:"@pre_count", false)
164
-
165
- subject.should_not_receive(:pre_count_truncate_tables)
166
- subject.should_receive(:truncate_tables)
167
-
168
- subject.clean
169
- end
170
- end
171
- end
172
- end
173
- half_supported_configurations.each do |config|
174
- describe "Sequel truncation (using a #{config[:url]} connection)" do
175
- let(:db) { ::Sequel.connect(config[:url], config[:connection_options]) }
176
-
177
- it_behaves_like 'a Sequel truncation strategy'
178
- it_behaves_like 'a truncation strategy without autoincrement resets'
179
- end
180
- end
181
- end
182
- end