database_cleaner 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTE.markdown +28 -0
  3. data/Gemfile.lock +182 -116
  4. data/History.rdoc +18 -1
  5. data/README.markdown +41 -4
  6. data/Rakefile +1 -17
  7. data/VERSION.yml +2 -3
  8. data/examples/Gemfile +17 -15
  9. data/examples/Gemfile.lock +182 -116
  10. data/examples/features/step_definitions/neo4j_steps.rb +23 -0
  11. data/examples/features/support/env.rb +0 -3
  12. data/examples/lib/mongoid_models.rb +1 -6
  13. data/examples/lib/neo4j_models.rb +17 -0
  14. data/examples/lib/sequel_models.rb +9 -0
  15. data/features/cleaning.feature +6 -0
  16. data/features/cleaning_default_strategy.feature +2 -0
  17. data/features/cleaning_multiple_dbs.feature +2 -0
  18. data/features/cleaning_multiple_orms.feature +19 -0
  19. data/features/step_definitions/database_cleaner_steps.rb +1 -1
  20. data/lib/database_cleaner/active_record/deletion.rb +30 -0
  21. data/lib/database_cleaner/active_record/truncation.rb +29 -1
  22. data/lib/database_cleaner/base.rb +4 -0
  23. data/lib/database_cleaner/configuration.rb +2 -0
  24. data/lib/database_cleaner/data_mapper/truncation.rb +5 -42
  25. data/lib/database_cleaner/mongo/base.rb +2 -0
  26. data/lib/database_cleaner/mongo/truncation.rb +40 -0
  27. data/lib/database_cleaner/mongoid/truncation.rb +8 -1
  28. data/lib/database_cleaner/moped/truncation_base.rb +1 -1
  29. data/lib/database_cleaner/neo4j/base.rb +58 -0
  30. data/lib/database_cleaner/neo4j/deletion.rb +16 -0
  31. data/lib/database_cleaner/neo4j/transaction.rb +35 -0
  32. data/lib/database_cleaner/neo4j/truncation.rb +9 -0
  33. data/lib/database_cleaner/sequel/base.rb +2 -2
  34. data/lib/database_cleaner/sequel/deletion.rb +47 -0
  35. data/lib/database_cleaner/sequel/transaction.rb +5 -5
  36. data/lib/database_cleaner/sequel/truncation.rb +41 -13
  37. data/spec/database_cleaner/active_record/truncation/mysql2_spec.rb +1 -3
  38. data/spec/database_cleaner/active_record/truncation/mysql_spec.rb +2 -4
  39. data/spec/database_cleaner/active_record/truncation/postgresql_spec.rb +13 -4
  40. data/spec/database_cleaner/active_record/truncation/sqlite3_spec.rb +0 -2
  41. data/spec/database_cleaner/base_spec.rb +48 -12
  42. data/spec/database_cleaner/configuration_spec.rb +5 -0
  43. data/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb +41 -0
  44. data/spec/database_cleaner/moped/moped_examples.rb +6 -0
  45. data/spec/database_cleaner/moped/truncation_spec.rb +7 -2
  46. data/spec/database_cleaner/neo4j/base_spec.rb +36 -0
  47. data/spec/database_cleaner/neo4j/transaction_spec.rb +25 -0
  48. data/spec/database_cleaner/sequel/deletion_spec.rb +58 -0
  49. data/spec/database_cleaner/sequel/truncation_spec.rb +38 -0
  50. data/spec/support/active_record/mysql2_setup.rb +1 -2
  51. data/spec/support/active_record/mysql_setup.rb +1 -1
  52. data/spec/support/active_record/postgresql_setup.rb +1 -1
  53. data/spec/support/active_record/schema_setup.rb +8 -1
  54. data/spec/support/active_record/sqlite3_setup.rb +1 -1
  55. data/spec/support/data_mapper/schema_setup.rb +15 -0
  56. data/spec/support/data_mapper/sqlite3_setup.rb +39 -0
  57. metadata +136 -111
@@ -336,5 +336,10 @@ describe ::DatabaseCleaner do
336
336
  subject.orm_module(:couch_potato).should eq DatabaseCleaner::CouchPotato
337
337
  end
338
338
 
339
+ it "should return DatabaseCleaner::Neo4j for :neo4j" do
340
+ ::DatabaseCleaner::Neo4j = double("nj module") unless defined? ::DatabaseCleaner::Neo4j
341
+ subject.orm_module(:neo4j).should eq DatabaseCleaner::Neo4j
342
+ end
343
+
339
344
  end
340
345
  end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ require 'dm-core'
3
+ require 'dm-sqlite-adapter'
4
+ require File.expand_path('../../../../support/data_mapper/sqlite3_setup', __FILE__)
5
+ require 'database_cleaner/data_mapper/truncation'
6
+
7
+ module DataMapper
8
+ module ConnectionAdapters
9
+ describe do
10
+ before(:all) { data_mapper_sqlite3_setup }
11
+
12
+ let(:adapter) { DataMapperSQLite3Adapter }
13
+
14
+ let(:connection) do
15
+ data_mapper_sqlite3_connection
16
+ end
17
+
18
+ before(:each) do
19
+ connection.truncate_tables(DataMapper::Model.descendants.map { |d| d.storage_names[:default] || d.name.underscore })
20
+ end
21
+
22
+ describe "#truncate_table" do
23
+ it "truncates the table" do
24
+ 2.times { DmUser.create }
25
+
26
+ connection.truncate_table(DmUser.storage_names[:default])
27
+ DmUser.count.should eq 0
28
+ end
29
+
30
+ it "resets AUTO_INCREMENT index of table" do
31
+ 2.times { DmUser.create }
32
+ DmUser.destroy
33
+
34
+ connection.truncate_table(DmUser.storage_names[:default])
35
+
36
+ DmUser.create.id.should eq 1
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -23,4 +23,10 @@ module MopedTest
23
23
  end
24
24
  class Gadget < ThingBase
25
25
  end
26
+ class System < ThingBase
27
+ def self.collection
28
+ super
29
+ @collection = @session['system_logs']
30
+ end
31
+ end
26
32
  end
@@ -39,12 +39,17 @@ module DatabaseCleaner
39
39
  MopedTest::Gadget.new({:name => 'some gadget'}.merge(attrs)).save!
40
40
  end
41
41
 
42
+ def create_system(attrs={})
43
+ MopedTest::System.new({:name => 'some system'}.merge(attrs)).save!
44
+ end
45
+
42
46
  it "truncates all collections by default" do
43
47
  create_widget
44
48
  create_gadget
45
- ensure_counts(MopedTest::Widget => 1, MopedTest::Gadget => 1)
49
+ create_system
50
+ ensure_counts(MopedTest::Widget => 1, MopedTest::Gadget => 1, MopedTest::System => 1)
46
51
  truncation.clean
47
- ensure_counts(MopedTest::Widget => 0, MopedTest::Gadget => 0)
52
+ ensure_counts(MopedTest::Widget => 0, MopedTest::Gadget => 0, MopedTest::System => 0)
48
53
  end
49
54
 
50
55
  context "when collections are provided to the :only option" do
@@ -0,0 +1,36 @@
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 default to nil" do
28
+ subject.db.should be_nil
29
+ end
30
+
31
+ it "should return default configuration" do
32
+ subject.database.should eq(:type => :server_db, :path => 'http://localhost:7475/')
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,58 @@
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
@@ -130,6 +130,44 @@ module DatabaseCleaner
130
130
 
131
131
  it_behaves_like 'a Sequel truncation strategy'
132
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
133
171
  end
134
172
  end
135
173
  half_supported_configurations.each do |config|
@@ -26,7 +26,7 @@ module MySQL2Helper
26
26
  def active_record_mysql2_setup
27
27
  create_db
28
28
  establish_connection
29
- load_schema
29
+ active_record_load_schema
30
30
  end
31
31
 
32
32
  def active_record_mysql2_connection
@@ -37,4 +37,3 @@ end
37
37
  RSpec.configure do |c|
38
38
  c.include MySQL2Helper
39
39
  end
40
-
@@ -25,7 +25,7 @@ module MySQLHelper
25
25
  def active_record_mysql_setup
26
26
  create_db
27
27
  establish_connection
28
- load_schema
28
+ active_record_load_schema
29
29
  end
30
30
 
31
31
  def active_record_mysql_connection
@@ -28,7 +28,7 @@ module PostgreSQLHelper
28
28
  def active_record_pg_setup
29
29
  create_db
30
30
  establish_connection
31
- load_schema
31
+ active_record_load_schema
32
32
  end
33
33
 
34
34
  def active_record_pg_connection
@@ -1,10 +1,17 @@
1
- def load_schema
1
+ def active_record_load_schema
2
2
  ActiveRecord::Schema.define do
3
3
  create_table :users, :force => true do |t|
4
4
  t.integer :name
5
5
  end
6
+
7
+ create_table :agents, :id => false, :force => true do |t|
8
+ t.integer :name
9
+ end
6
10
  end
7
11
  end
8
12
 
9
13
  class ::User < ActiveRecord::Base
10
14
  end
15
+
16
+ class ::Agent < ActiveRecord::Base
17
+ end
@@ -27,7 +27,7 @@ module SQLite3Helper
27
27
  def active_record_sqlite3_setup
28
28
  create_db
29
29
  establish_connection
30
- load_schema
30
+ active_record_load_schema
31
31
  end
32
32
 
33
33
  def active_record_sqlite3_connection
@@ -0,0 +1,15 @@
1
+ def data_mapper_load_schema
2
+ require 'dm-migrations'
3
+
4
+ DataMapper.auto_migrate!
5
+ end
6
+
7
+ class ::DmUser
8
+ include DataMapper::Resource
9
+
10
+ self.storage_names[:default] = 'users'
11
+
12
+ property :id, Serial
13
+ property :name, String
14
+
15
+ end
@@ -0,0 +1,39 @@
1
+ require 'support/active_record/database_setup'
2
+ require 'support/data_mapper/schema_setup'
3
+
4
+ module DataMapperSQLite3Helper
5
+
6
+ puts "DataMapper #{DataMapper::VERSION}, sqlite3"
7
+
8
+ def config
9
+ db_config['sqlite3']
10
+ end
11
+
12
+ def create_db
13
+ @encoding = config['encoding'] || ENV['CHARSET'] || 'utf8'
14
+ begin
15
+ establish_connection(config.merge('database' => 'sqlite3', 'schema_search_path' => 'public'))
16
+ rescue Exception => e
17
+ $stderr.puts e, *(e.backtrace)
18
+ $stderr.puts "Couldn't create database for #{config.inspect}"
19
+ end
20
+ end
21
+
22
+ def establish_connection(config = config)
23
+ DataMapper.setup(:default, config)
24
+ end
25
+
26
+ def data_mapper_sqlite3_setup
27
+ create_db
28
+ establish_connection
29
+ data_mapper_load_schema
30
+ end
31
+
32
+ def data_mapper_sqlite3_connection
33
+ DataMapper.repository.adapter
34
+ end
35
+ end
36
+
37
+ RSpec.configure do |c|
38
+ c.include(DataMapperSQLite3Helper)
39
+ end
metadata CHANGED
@@ -1,350 +1,363 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
5
- prerelease:
4
+ version: 1.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ben Mabey
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-24 00:00:00.000000000 Z
11
+ date: 2015-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
- name: bundler
28
+ name: ruby-debug
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-debug19
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
- - - ! '>='
45
+ - - ">="
36
46
  - !ruby/object:Gem::Version
37
47
  version: '0'
38
48
  type: :development
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
- - - ! '>='
52
+ - - ">="
44
53
  - !ruby/object:Gem::Version
45
54
  version: '0'
46
55
  - !ruby/object:Gem::Dependency
47
- name: jeweler
56
+ name: bundler
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
61
  version: '0'
54
62
  type: :development
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - ">="
60
67
  - !ruby/object:Gem::Version
61
68
  version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: json_pure
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - ">="
68
74
  - !ruby/object:Gem::Version
69
75
  version: '0'
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: activerecord-mysql2-adapter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
76
95
  - !ruby/object:Gem::Version
77
96
  version: '0'
78
97
  - !ruby/object:Gem::Dependency
79
98
  name: activerecord
80
99
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
100
  requirements:
83
- - - ! '>='
101
+ - - ">="
84
102
  - !ruby/object:Gem::Version
85
103
  version: '0'
86
104
  type: :development
87
105
  prerelease: false
88
106
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
107
  requirements:
91
- - - ! '>='
108
+ - - ">="
92
109
  - !ruby/object:Gem::Version
93
110
  version: '0'
94
111
  - !ruby/object:Gem::Dependency
95
112
  name: datamapper
96
113
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
114
  requirements:
99
- - - ! '>='
115
+ - - ">="
100
116
  - !ruby/object:Gem::Version
101
117
  version: '0'
102
118
  type: :development
103
119
  prerelease: false
104
120
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
121
  requirements:
107
- - - ! '>='
122
+ - - ">="
108
123
  - !ruby/object:Gem::Version
109
124
  version: '0'
110
125
  - !ruby/object:Gem::Dependency
111
126
  name: dm-migrations
112
127
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
128
  requirements:
115
- - - ! '>='
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
135
  requirements:
123
- - - ! '>='
136
+ - - ">="
124
137
  - !ruby/object:Gem::Version
125
138
  version: '0'
126
139
  - !ruby/object:Gem::Dependency
127
140
  name: dm-sqlite-adapter
128
141
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
142
  requirements:
131
- - - ! '>='
143
+ - - ">="
132
144
  - !ruby/object:Gem::Version
133
145
  version: '0'
134
146
  type: :development
135
147
  prerelease: false
136
148
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
149
  requirements:
139
- - - ! '>='
150
+ - - ">="
140
151
  - !ruby/object:Gem::Version
141
152
  version: '0'
142
153
  - !ruby/object:Gem::Dependency
143
154
  name: mongoid
144
155
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
156
  requirements:
147
- - - ! '>='
157
+ - - ">="
148
158
  - !ruby/object:Gem::Version
149
159
  version: '0'
150
160
  type: :development
151
161
  prerelease: false
152
162
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
163
  requirements:
155
- - - ! '>='
164
+ - - ">="
156
165
  - !ruby/object:Gem::Version
157
166
  version: '0'
158
167
  - !ruby/object:Gem::Dependency
159
168
  name: tzinfo
160
169
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
170
  requirements:
163
- - - ! '>='
171
+ - - ">="
164
172
  - !ruby/object:Gem::Version
165
173
  version: '0'
166
174
  type: :development
167
175
  prerelease: false
168
176
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
177
  requirements:
171
- - - ! '>='
178
+ - - ">="
172
179
  - !ruby/object:Gem::Version
173
180
  version: '0'
174
181
  - !ruby/object:Gem::Dependency
175
182
  name: mongo_ext
176
183
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
184
  requirements:
179
- - - ! '>='
185
+ - - ">="
180
186
  - !ruby/object:Gem::Version
181
187
  version: '0'
182
188
  type: :development
183
189
  prerelease: false
184
190
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
191
  requirements:
187
- - - ! '>='
192
+ - - ">="
188
193
  - !ruby/object:Gem::Version
189
194
  version: '0'
190
195
  - !ruby/object:Gem::Dependency
191
196
  name: bson_ext
192
197
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
198
  requirements:
195
- - - ! '>='
199
+ - - ">="
196
200
  - !ruby/object:Gem::Version
197
201
  version: '0'
198
202
  type: :development
199
203
  prerelease: false
200
204
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
205
  requirements:
203
- - - ! '>='
206
+ - - ">="
204
207
  - !ruby/object:Gem::Version
205
208
  version: '0'
206
209
  - !ruby/object:Gem::Dependency
207
- name: mongo_mapper
210
+ name: mongoid-tree
208
211
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
212
  requirements:
211
- - - ! '>='
213
+ - - ">="
212
214
  - !ruby/object:Gem::Version
213
215
  version: '0'
214
216
  type: :development
215
217
  prerelease: false
216
218
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
219
  requirements:
219
- - - ! '>='
220
+ - - ">="
220
221
  - !ruby/object:Gem::Version
221
222
  version: '0'
222
223
  - !ruby/object:Gem::Dependency
223
- name: couch_potato
224
+ name: mongo_mapper
224
225
  requirement: !ruby/object:Gem::Requirement
225
- none: false
226
226
  requirements:
227
- - - ! '>='
227
+ - - ">="
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
233
  requirements:
235
- - - ! '>='
234
+ - - ">="
236
235
  - !ruby/object:Gem::Version
237
236
  version: '0'
238
237
  - !ruby/object:Gem::Dependency
239
- name: sequel
238
+ name: moped
240
239
  requirement: !ruby/object:Gem::Requirement
241
- none: false
242
240
  requirements:
243
- - - ~>
241
+ - - ">="
244
242
  - !ruby/object:Gem::Version
245
- version: 3.21.0
243
+ version: '0'
246
244
  type: :development
247
245
  prerelease: false
248
246
  version_requirements: !ruby/object:Gem::Requirement
249
- none: false
250
247
  requirements:
251
- - - ~>
248
+ - - ">="
252
249
  - !ruby/object:Gem::Version
253
- version: 3.21.0
250
+ version: '0'
254
251
  - !ruby/object:Gem::Dependency
255
- name: mysql
252
+ name: neo4j-core
256
253
  requirement: !ruby/object:Gem::Requirement
257
- none: false
258
254
  requirements:
259
- - - ~>
255
+ - - ">="
260
256
  - !ruby/object:Gem::Version
261
- version: 2.8.1
257
+ version: '0'
262
258
  type: :development
263
259
  prerelease: false
264
260
  version_requirements: !ruby/object:Gem::Requirement
265
- none: false
266
261
  requirements:
267
- - - ~>
262
+ - - ">="
268
263
  - !ruby/object:Gem::Version
269
- version: 2.8.1
264
+ version: '0'
270
265
  - !ruby/object:Gem::Dependency
271
- name: mysql2
266
+ name: couch_potato
272
267
  requirement: !ruby/object:Gem::Requirement
273
- none: false
274
268
  requirements:
275
- - - ! '>='
269
+ - - ">="
276
270
  - !ruby/object:Gem::Version
277
271
  version: '0'
278
272
  type: :development
279
273
  prerelease: false
280
274
  version_requirements: !ruby/object:Gem::Requirement
281
- none: false
282
275
  requirements:
283
- - - ! '>='
276
+ - - ">="
284
277
  - !ruby/object:Gem::Version
285
278
  version: '0'
286
279
  - !ruby/object:Gem::Dependency
287
- name: pg
280
+ name: sequel
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: 3.21.0
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: 3.21.0
293
+ - !ruby/object:Gem::Dependency
294
+ name: mysql
288
295
  requirement: !ruby/object:Gem::Requirement
289
- none: false
290
296
  requirements:
291
- - - ! '>='
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: 2.8.1
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: 2.8.1
307
+ - !ruby/object:Gem::Dependency
308
+ name: mysql2
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - ">="
292
312
  - !ruby/object:Gem::Version
293
313
  version: '0'
294
314
  type: :development
295
315
  prerelease: false
296
316
  version_requirements: !ruby/object:Gem::Requirement
297
- none: false
298
317
  requirements:
299
- - - ! '>='
318
+ - - ">="
300
319
  - !ruby/object:Gem::Version
301
320
  version: '0'
302
321
  - !ruby/object:Gem::Dependency
303
- name: sqlite3
322
+ name: pg
304
323
  requirement: !ruby/object:Gem::Requirement
305
- none: false
306
324
  requirements:
307
- - - ! '>='
325
+ - - ">="
308
326
  - !ruby/object:Gem::Version
309
327
  version: '0'
310
328
  type: :development
311
329
  prerelease: false
312
330
  version_requirements: !ruby/object:Gem::Requirement
313
- none: false
314
331
  requirements:
315
- - - ! '>='
332
+ - - ">="
316
333
  - !ruby/object:Gem::Version
317
334
  version: '0'
318
335
  - !ruby/object:Gem::Dependency
319
336
  name: ohm
320
337
  requirement: !ruby/object:Gem::Requirement
321
- none: false
322
338
  requirements:
323
- - - ~>
339
+ - - "~>"
324
340
  - !ruby/object:Gem::Version
325
341
  version: 0.1.3
326
342
  type: :development
327
343
  prerelease: false
328
344
  version_requirements: !ruby/object:Gem::Requirement
329
- none: false
330
345
  requirements:
331
- - - ~>
346
+ - - "~>"
332
347
  - !ruby/object:Gem::Version
333
348
  version: 0.1.3
334
349
  - !ruby/object:Gem::Dependency
335
350
  name: guard-rspec
336
351
  requirement: !ruby/object:Gem::Requirement
337
- none: false
338
352
  requirements:
339
- - - ! '>='
353
+ - - ">="
340
354
  - !ruby/object:Gem::Version
341
355
  version: '0'
342
356
  type: :development
343
357
  prerelease: false
344
358
  version_requirements: !ruby/object:Gem::Requirement
345
- none: false
346
359
  requirements:
347
- - - ! '>='
360
+ - - ">="
348
361
  - !ruby/object:Gem::Version
349
362
  version: '0'
350
363
  description: Strategies for cleaning databases. Can be used to ensure a clean state
@@ -357,10 +370,13 @@ extra_rdoc_files:
357
370
  - README.markdown
358
371
  - TODO
359
372
  files:
373
+ - CONTRIBUTE.markdown
360
374
  - Gemfile.lock
361
375
  - History.rdoc
376
+ - LICENSE
362
377
  - README.markdown
363
378
  - Rakefile
379
+ - TODO
364
380
  - VERSION.yml
365
381
  - cucumber.yml
366
382
  - examples/Gemfile
@@ -376,6 +392,7 @@ files:
376
392
  - examples/features/step_definitions/datamapper_steps.rb
377
393
  - examples/features/step_definitions/mongoid_steps.rb
378
394
  - examples/features/step_definitions/mongomapper_steps.rb
395
+ - examples/features/step_definitions/neo4j_steps.rb
379
396
  - examples/features/step_definitions/translation_steps.rb
380
397
  - examples/features/support/env.rb
381
398
  - examples/lib/activerecord_models.rb
@@ -383,8 +400,10 @@ files:
383
400
  - examples/lib/datamapper_models.rb
384
401
  - examples/lib/mongoid_models.rb
385
402
  - examples/lib/mongomapper_models.rb
403
+ - examples/lib/neo4j_models.rb
386
404
  - examples/lib/ohm_models.rb
387
405
  - examples/lib/redis_models.rb
406
+ - examples/lib/sequel_models.rb
388
407
  - features/cleaning.feature
389
408
  - features/cleaning_default_strategy.feature
390
409
  - features/cleaning_multiple_dbs.feature
@@ -420,11 +439,16 @@ files:
420
439
  - lib/database_cleaner/moped/base.rb
421
440
  - lib/database_cleaner/moped/truncation.rb
422
441
  - lib/database_cleaner/moped/truncation_base.rb
442
+ - lib/database_cleaner/neo4j/base.rb
443
+ - lib/database_cleaner/neo4j/deletion.rb
444
+ - lib/database_cleaner/neo4j/transaction.rb
445
+ - lib/database_cleaner/neo4j/truncation.rb
423
446
  - lib/database_cleaner/null_strategy.rb
424
447
  - lib/database_cleaner/ohm/truncation.rb
425
448
  - lib/database_cleaner/redis/base.rb
426
449
  - lib/database_cleaner/redis/truncation.rb
427
450
  - lib/database_cleaner/sequel/base.rb
451
+ - lib/database_cleaner/sequel/deletion.rb
428
452
  - lib/database_cleaner/sequel/transaction.rb
429
453
  - lib/database_cleaner/sequel/truncation.rb
430
454
  - spec/database_cleaner/active_record/base_spec.rb
@@ -440,6 +464,7 @@ files:
440
464
  - spec/database_cleaner/couch_potato/truncation_spec.rb
441
465
  - spec/database_cleaner/data_mapper/base_spec.rb
442
466
  - spec/database_cleaner/data_mapper/transaction_spec.rb
467
+ - spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
443
468
  - spec/database_cleaner/data_mapper/truncation_spec.rb
444
469
  - spec/database_cleaner/generic/base_spec.rb
445
470
  - spec/database_cleaner/generic/truncation_spec.rb
@@ -450,10 +475,13 @@ files:
450
475
  - spec/database_cleaner/mongo_mapper/truncation_spec.rb
451
476
  - spec/database_cleaner/moped/moped_examples.rb
452
477
  - spec/database_cleaner/moped/truncation_spec.rb
478
+ - spec/database_cleaner/neo4j/base_spec.rb
479
+ - spec/database_cleaner/neo4j/transaction_spec.rb
453
480
  - spec/database_cleaner/ohm/truncation_spec.rb
454
481
  - spec/database_cleaner/redis/base_spec.rb
455
482
  - spec/database_cleaner/redis/truncation_spec.rb
456
483
  - spec/database_cleaner/sequel/base_spec.rb
484
+ - spec/database_cleaner/sequel/deletion_spec.rb
457
485
  - spec/database_cleaner/sequel/transaction_spec.rb
458
486
  - spec/database_cleaner/sequel/truncation/sqlite3_spec.rb
459
487
  - spec/database_cleaner/sequel/truncation_spec.rb
@@ -466,34 +494,31 @@ files:
466
494
  - spec/support/active_record/postgresql_setup.rb
467
495
  - spec/support/active_record/schema_setup.rb
468
496
  - spec/support/active_record/sqlite3_setup.rb
469
- - LICENSE
470
- - TODO
497
+ - spec/support/data_mapper/schema_setup.rb
498
+ - spec/support/data_mapper/sqlite3_setup.rb
471
499
  homepage: http://github.com/bmabey/database_cleaner
472
500
  licenses: []
501
+ metadata: {}
473
502
  post_install_message:
474
503
  rdoc_options: []
475
504
  require_paths:
476
505
  - lib
477
506
  required_ruby_version: !ruby/object:Gem::Requirement
478
- none: false
479
507
  requirements:
480
- - - ! '>='
508
+ - - ">="
481
509
  - !ruby/object:Gem::Version
482
510
  version: '0'
483
- segments:
484
- - 0
485
- hash: 2066839847000143499
486
511
  required_rubygems_version: !ruby/object:Gem::Requirement
487
- none: false
488
512
  requirements:
489
- - - ! '>='
513
+ - - ">="
490
514
  - !ruby/object:Gem::Version
491
515
  version: '0'
492
516
  requirements: []
493
517
  rubyforge_project:
494
- rubygems_version: 1.8.23
518
+ rubygems_version: 2.4.5
495
519
  signing_key:
496
- specification_version: 3
520
+ specification_version: 4
497
521
  summary: Strategies for cleaning databases. Can be used to ensure a clean state for
498
522
  testing.
499
523
  test_files: []
524
+ has_rdoc: