database_cleaner 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTE.markdown +28 -0
- data/Gemfile.lock +182 -116
- data/History.rdoc +18 -1
- data/README.markdown +41 -4
- data/Rakefile +1 -17
- data/VERSION.yml +2 -3
- data/examples/Gemfile +17 -15
- data/examples/Gemfile.lock +182 -116
- data/examples/features/step_definitions/neo4j_steps.rb +23 -0
- data/examples/features/support/env.rb +0 -3
- data/examples/lib/mongoid_models.rb +1 -6
- data/examples/lib/neo4j_models.rb +17 -0
- data/examples/lib/sequel_models.rb +9 -0
- data/features/cleaning.feature +6 -0
- data/features/cleaning_default_strategy.feature +2 -0
- data/features/cleaning_multiple_dbs.feature +2 -0
- data/features/cleaning_multiple_orms.feature +19 -0
- data/features/step_definitions/database_cleaner_steps.rb +1 -1
- data/lib/database_cleaner/active_record/deletion.rb +30 -0
- data/lib/database_cleaner/active_record/truncation.rb +29 -1
- data/lib/database_cleaner/base.rb +4 -0
- data/lib/database_cleaner/configuration.rb +2 -0
- data/lib/database_cleaner/data_mapper/truncation.rb +5 -42
- data/lib/database_cleaner/mongo/base.rb +2 -0
- data/lib/database_cleaner/mongo/truncation.rb +40 -0
- data/lib/database_cleaner/mongoid/truncation.rb +8 -1
- data/lib/database_cleaner/moped/truncation_base.rb +1 -1
- data/lib/database_cleaner/neo4j/base.rb +58 -0
- data/lib/database_cleaner/neo4j/deletion.rb +16 -0
- data/lib/database_cleaner/neo4j/transaction.rb +35 -0
- data/lib/database_cleaner/neo4j/truncation.rb +9 -0
- data/lib/database_cleaner/sequel/base.rb +2 -2
- data/lib/database_cleaner/sequel/deletion.rb +47 -0
- data/lib/database_cleaner/sequel/transaction.rb +5 -5
- data/lib/database_cleaner/sequel/truncation.rb +41 -13
- data/spec/database_cleaner/active_record/truncation/mysql2_spec.rb +1 -3
- data/spec/database_cleaner/active_record/truncation/mysql_spec.rb +2 -4
- data/spec/database_cleaner/active_record/truncation/postgresql_spec.rb +13 -4
- data/spec/database_cleaner/active_record/truncation/sqlite3_spec.rb +0 -2
- data/spec/database_cleaner/base_spec.rb +48 -12
- data/spec/database_cleaner/configuration_spec.rb +5 -0
- data/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb +41 -0
- data/spec/database_cleaner/moped/moped_examples.rb +6 -0
- data/spec/database_cleaner/moped/truncation_spec.rb +7 -2
- data/spec/database_cleaner/neo4j/base_spec.rb +36 -0
- data/spec/database_cleaner/neo4j/transaction_spec.rb +25 -0
- data/spec/database_cleaner/sequel/deletion_spec.rb +58 -0
- data/spec/database_cleaner/sequel/truncation_spec.rb +38 -0
- data/spec/support/active_record/mysql2_setup.rb +1 -2
- data/spec/support/active_record/mysql_setup.rb +1 -1
- data/spec/support/active_record/postgresql_setup.rb +1 -1
- data/spec/support/active_record/schema_setup.rb +8 -1
- data/spec/support/active_record/sqlite3_setup.rb +1 -1
- data/spec/support/data_mapper/schema_setup.rb +15 -0
- data/spec/support/data_mapper/sqlite3_setup.rb +39 -0
- metadata +136 -111
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 4527ac30a6efa3d7c5938b87344a51f1ab0c7314
|
|
4
|
+
data.tar.gz: cbdaea723b3b1a2de12449af9b3cef9539e2dd4e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 196e5a7355500166c4738165b498bb2c4886a1091317a1a9fb99552efcc4f659109f0093778bf3cbfd88eb4afcdec431c30b9f591a037c9900cffd707b7b9670
|
|
7
|
+
data.tar.gz: 664d22fb94baa71bc7610cb919c3ea8180a55117667b5ac671a6d826c27b586cb40ec1ff4e447f1bc554ac6bb3aa50da5296c55244a1e623250ac99014d7998f
|
data/CONTRIBUTE.markdown
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Guidelines for contributing
|
|
2
|
+
|
|
3
|
+
## 1. Fork & Clone
|
|
4
|
+
|
|
5
|
+
Since you probably don't have rights to the main repo, you should Fork it (big
|
|
6
|
+
button up top). After that, clone your fork locally and optionally add an
|
|
7
|
+
upstream:
|
|
8
|
+
|
|
9
|
+
git remote add upstream git@github.com:DatabaseCleaner/database_cleaner.git
|
|
10
|
+
|
|
11
|
+
## 2. Make sure the tests run fine
|
|
12
|
+
|
|
13
|
+
- `bundle install`
|
|
14
|
+
- Copy `db/sample.config.yml` to `db/config.yml` and edit it
|
|
15
|
+
- Make sure to create the databases specified in `db/config.yml`
|
|
16
|
+
- Run the tests with `bundle exec rspec`
|
|
17
|
+
|
|
18
|
+
Note that if you don't have all the supported databases installed and running,
|
|
19
|
+
some tests will fail.
|
|
20
|
+
|
|
21
|
+
## 3. Prepare your contribution
|
|
22
|
+
|
|
23
|
+
This is all up to you but a few points should be kept in mind:
|
|
24
|
+
|
|
25
|
+
- Please write tests for your contribution
|
|
26
|
+
- Make sure that previous tests still pass
|
|
27
|
+
- Push it to a branch of your fork
|
|
28
|
+
- Submit a pull request
|
data/Gemfile.lock
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
GEM
|
|
2
|
-
remote:
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
rack
|
|
12
|
-
rack-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
4
|
+
abstract (1.0.0)
|
|
5
|
+
actionpack (3.0.0)
|
|
6
|
+
activemodel (= 3.0.0)
|
|
7
|
+
activesupport (= 3.0.0)
|
|
8
|
+
builder (~> 2.1.2)
|
|
9
|
+
erubis (~> 2.6.6)
|
|
10
|
+
i18n (~> 0.4.1)
|
|
11
|
+
rack (~> 1.2.1)
|
|
12
|
+
rack-mount (~> 0.6.12)
|
|
13
|
+
rack-test (~> 0.5.4)
|
|
14
|
+
tzinfo (~> 0.3.23)
|
|
15
|
+
activemodel (3.0.0)
|
|
16
|
+
activesupport (= 3.0.0)
|
|
17
|
+
builder (~> 2.1.2)
|
|
18
|
+
i18n (~> 0.4.1)
|
|
19
|
+
activerecord (3.0.0)
|
|
20
|
+
activemodel (= 3.0.0)
|
|
21
|
+
activesupport (= 3.0.0)
|
|
22
|
+
arel (~> 1.0.0)
|
|
23
|
+
tzinfo (~> 0.3.23)
|
|
24
|
+
activerecord-mysql2-adapter (0.0.3)
|
|
25
|
+
mysql2
|
|
26
|
+
activesupport (3.0.0)
|
|
27
|
+
addressable (2.3.6)
|
|
28
|
+
archive-tar-minitar (0.5.2)
|
|
29
|
+
arel (1.0.1)
|
|
30
|
+
activesupport (~> 3.0.0)
|
|
31
|
+
bcrypt (3.1.7)
|
|
32
|
+
bcrypt (3.1.7-java)
|
|
33
|
+
bcrypt-ruby (3.1.5)
|
|
34
|
+
bcrypt (>= 3.1.3)
|
|
35
|
+
bcrypt-ruby (3.1.5-java)
|
|
36
|
+
bcrypt (>= 3.1.3)
|
|
37
|
+
bson (1.11.1)
|
|
38
|
+
bson (1.11.1-java)
|
|
39
|
+
bson_ext (1.11.1)
|
|
40
|
+
bson (~> 1.11.1)
|
|
41
|
+
builder (2.1.2)
|
|
42
|
+
coderay (1.1.0)
|
|
43
|
+
columnize (0.8.9)
|
|
44
|
+
couch_potato (1.3.0)
|
|
34
45
|
activemodel
|
|
35
|
-
couchrest (
|
|
46
|
+
couchrest (~> 1.2.0)
|
|
36
47
|
json (~> 1.6)
|
|
37
|
-
couchrest (1.
|
|
48
|
+
couchrest (1.2.0)
|
|
38
49
|
mime-types (~> 1.15)
|
|
39
50
|
multi_json (~> 1.0)
|
|
40
51
|
rest-client (~> 1.6.1)
|
|
@@ -43,7 +54,7 @@ GEM
|
|
|
43
54
|
diff-lcs (>= 1.1.3)
|
|
44
55
|
gherkin (~> 2.11.0)
|
|
45
56
|
json (>= 1.4.6)
|
|
46
|
-
data_objects (0.10.
|
|
57
|
+
data_objects (0.10.14)
|
|
47
58
|
addressable (~> 2.1)
|
|
48
59
|
datamapper (1.2.0)
|
|
49
60
|
dm-aggregates (~> 1.2.0)
|
|
@@ -60,8 +71,8 @@ GEM
|
|
|
60
71
|
dm-core (~> 1.2.0)
|
|
61
72
|
dm-constraints (1.2.0)
|
|
62
73
|
dm-core (~> 1.2.0)
|
|
63
|
-
dm-core (1.2.
|
|
64
|
-
addressable (~> 2.
|
|
74
|
+
dm-core (1.2.1)
|
|
75
|
+
addressable (~> 2.3)
|
|
65
76
|
dm-do-adapter (1.2.0)
|
|
66
77
|
data_objects (~> 0.10.6)
|
|
67
78
|
dm-core (~> 1.2.0)
|
|
@@ -90,119 +101,170 @@ GEM
|
|
|
90
101
|
uuidtools (~> 2.1)
|
|
91
102
|
dm-validations (1.2.0)
|
|
92
103
|
dm-core (~> 1.2.0)
|
|
93
|
-
do_sqlite3 (0.10.
|
|
94
|
-
data_objects (= 0.10.
|
|
95
|
-
erubis (2.
|
|
104
|
+
do_sqlite3 (0.10.14)
|
|
105
|
+
data_objects (= 0.10.14)
|
|
106
|
+
erubis (2.6.6)
|
|
107
|
+
abstract (>= 1.0.0)
|
|
108
|
+
faraday (0.9.0)
|
|
109
|
+
multipart-post (>= 1.2, < 3)
|
|
110
|
+
faraday_middleware (0.9.1)
|
|
111
|
+
faraday (>= 0.7.4, < 0.10)
|
|
96
112
|
fastercsv (1.5.5)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
ffi (1.9.6)
|
|
114
|
+
ffi (1.9.6-java)
|
|
115
|
+
formatador (0.2.5)
|
|
116
|
+
gherkin (2.11.6)
|
|
117
|
+
json (>= 1.7.6)
|
|
118
|
+
gherkin (2.11.6-java)
|
|
119
|
+
json (>= 1.7.6)
|
|
120
|
+
guard (1.8.3)
|
|
121
|
+
formatador (>= 0.2.4)
|
|
122
|
+
listen (~> 1.3)
|
|
102
123
|
lumberjack (>= 1.0.2)
|
|
103
124
|
pry (>= 0.9.10)
|
|
104
125
|
thor (>= 0.14.6)
|
|
105
|
-
guard-rspec (2.
|
|
126
|
+
guard-rspec (2.5.4)
|
|
106
127
|
guard (>= 1.1)
|
|
107
128
|
rspec (~> 2.11)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
httparty (0.13.3)
|
|
130
|
+
json (~> 1.8)
|
|
131
|
+
multi_xml (>= 0.5.2)
|
|
132
|
+
httpclient (2.5.3.3)
|
|
133
|
+
i18n (0.4.2)
|
|
134
|
+
json (1.8.1)
|
|
135
|
+
json (1.8.1-java)
|
|
136
|
+
json_pure (1.8.1)
|
|
137
|
+
linecache (0.46)
|
|
138
|
+
rbx-require-relative (> 0.0.4)
|
|
139
|
+
linecache19 (0.5.12)
|
|
140
|
+
ruby_core_source (>= 0.1.4)
|
|
141
|
+
listen (1.3.1)
|
|
142
|
+
rb-fsevent (>= 0.9.3)
|
|
143
|
+
rb-inotify (>= 0.9)
|
|
144
|
+
rb-kqueue (>= 0.2)
|
|
145
|
+
lumberjack (1.0.9)
|
|
146
|
+
method_source (0.8.2)
|
|
147
|
+
mime-types (1.25.1)
|
|
148
|
+
mongo (1.11.1)
|
|
149
|
+
bson (= 1.11.1)
|
|
124
150
|
mongo_ext (0.19.3)
|
|
125
151
|
mongo_mapper (0.12.0)
|
|
126
152
|
activemodel (~> 3.0)
|
|
127
153
|
activesupport (~> 3.0)
|
|
128
154
|
plucky (~> 0.5.2)
|
|
129
|
-
mongoid (
|
|
130
|
-
activemodel (~> 3.
|
|
131
|
-
|
|
132
|
-
origin (~> 1.0)
|
|
155
|
+
mongoid (2.2.6)
|
|
156
|
+
activemodel (~> 3.0.0)
|
|
157
|
+
mongo (~> 1.3)
|
|
133
158
|
tzinfo (~> 0.3.22)
|
|
134
|
-
|
|
135
|
-
|
|
159
|
+
mongoid-tree (0.7.0)
|
|
160
|
+
mongoid (~> 2.0)
|
|
161
|
+
moped (1.5.2)
|
|
162
|
+
multi_json (1.2.0)
|
|
163
|
+
multi_xml (0.5.5)
|
|
164
|
+
multipart-post (2.0.0)
|
|
136
165
|
mysql (2.8.1)
|
|
137
|
-
mysql2 (0.3.
|
|
166
|
+
mysql2 (0.3.16)
|
|
167
|
+
neo4j-community (2.1.5)
|
|
168
|
+
neo4j-core (3.0.8)
|
|
169
|
+
activesupport
|
|
170
|
+
faraday (~> 0.9.0)
|
|
171
|
+
faraday_middleware (~> 0.9.1)
|
|
172
|
+
httparty
|
|
173
|
+
httpclient
|
|
174
|
+
json
|
|
175
|
+
neo4j-community (~> 2.1.1)
|
|
176
|
+
net-http-persistent
|
|
177
|
+
os
|
|
178
|
+
zip
|
|
138
179
|
nest (1.1.2)
|
|
139
180
|
redis
|
|
181
|
+
net-http-persistent (2.9.4)
|
|
140
182
|
ohm (0.1.5)
|
|
141
183
|
nest (~> 1.0)
|
|
142
|
-
|
|
143
|
-
pg (0.
|
|
184
|
+
os (0.9.6)
|
|
185
|
+
pg (0.17.1)
|
|
144
186
|
plucky (0.5.2)
|
|
145
187
|
mongo (~> 1.5)
|
|
146
|
-
pry (0.
|
|
147
|
-
coderay (~> 1.0
|
|
148
|
-
method_source (~> 0.8)
|
|
149
|
-
slop (~> 3.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
rack
|
|
188
|
+
pry (0.10.1)
|
|
189
|
+
coderay (~> 1.1.0)
|
|
190
|
+
method_source (~> 0.8.1)
|
|
191
|
+
slop (~> 3.4)
|
|
192
|
+
pry (0.10.1-java)
|
|
193
|
+
coderay (~> 1.1.0)
|
|
194
|
+
method_source (~> 0.8.1)
|
|
195
|
+
slop (~> 3.4)
|
|
196
|
+
spoon (~> 0.0)
|
|
197
|
+
rack (1.2.8)
|
|
198
|
+
rack-mount (0.6.14)
|
|
199
|
+
rack (>= 1.0.0)
|
|
200
|
+
rack-test (0.5.7)
|
|
156
201
|
rack (>= 1.0)
|
|
157
|
-
railties (3.
|
|
158
|
-
actionpack (= 3.
|
|
159
|
-
activesupport (= 3.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
202
|
+
railties (3.0.0)
|
|
203
|
+
actionpack (= 3.0.0)
|
|
204
|
+
activesupport (= 3.0.0)
|
|
205
|
+
rake (>= 0.8.4)
|
|
206
|
+
thor (~> 0.14.0)
|
|
207
|
+
rake (10.3.2)
|
|
208
|
+
rb-fsevent (0.9.4)
|
|
209
|
+
rb-inotify (0.9.5)
|
|
210
|
+
ffi (>= 0.5.0)
|
|
211
|
+
rb-kqueue (0.2.3)
|
|
212
|
+
ffi (>= 0.5.0)
|
|
213
|
+
rbx-require-relative (0.0.9)
|
|
214
|
+
rdoc (4.1.2)
|
|
166
215
|
json (~> 1.4)
|
|
167
|
-
redis (3.0
|
|
168
|
-
rest-client (1.6.
|
|
169
|
-
mime-types (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
rspec-
|
|
173
|
-
rspec-
|
|
174
|
-
|
|
175
|
-
rspec-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
rspec-
|
|
216
|
+
redis (3.1.0)
|
|
217
|
+
rest-client (1.6.8)
|
|
218
|
+
mime-types (~> 1.16)
|
|
219
|
+
rdoc (>= 2.4.2)
|
|
220
|
+
rspec (2.11.0)
|
|
221
|
+
rspec-core (~> 2.11.0)
|
|
222
|
+
rspec-expectations (~> 2.11.0)
|
|
223
|
+
rspec-mocks (~> 2.11.0)
|
|
224
|
+
rspec-core (2.11.1)
|
|
225
|
+
rspec-expectations (2.11.3)
|
|
226
|
+
diff-lcs (~> 1.1.3)
|
|
227
|
+
rspec-mocks (2.11.3)
|
|
228
|
+
rspec-rails (2.11.4)
|
|
179
229
|
actionpack (>= 3.0)
|
|
180
230
|
activesupport (>= 3.0)
|
|
181
231
|
railties (>= 3.0)
|
|
182
|
-
rspec
|
|
183
|
-
|
|
184
|
-
|
|
232
|
+
rspec (~> 2.11.0)
|
|
233
|
+
ruby-debug (0.10.4)
|
|
234
|
+
columnize (>= 0.1)
|
|
235
|
+
ruby-debug-base (~> 0.10.4.0)
|
|
236
|
+
ruby-debug-base (0.10.4)
|
|
237
|
+
linecache (>= 0.3)
|
|
238
|
+
ruby-debug-base19 (0.11.25)
|
|
239
|
+
columnize (>= 0.3.1)
|
|
240
|
+
linecache19 (>= 0.5.11)
|
|
241
|
+
ruby_core_source (>= 0.1.4)
|
|
242
|
+
ruby-debug19 (0.11.6)
|
|
243
|
+
columnize (>= 0.3.1)
|
|
244
|
+
linecache19 (>= 0.5.11)
|
|
245
|
+
ruby-debug-base19 (>= 0.11.19)
|
|
246
|
+
ruby_core_source (0.1.5)
|
|
247
|
+
archive-tar-minitar (>= 0.5.2)
|
|
185
248
|
sequel (3.21.0)
|
|
186
|
-
slop (3.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
rack (~> 1.0)
|
|
191
|
-
tilt (~> 1.1, != 1.3.0)
|
|
192
|
-
sqlite3 (1.3.6)
|
|
249
|
+
slop (3.6.0)
|
|
250
|
+
spoon (0.0.4)
|
|
251
|
+
ffi
|
|
252
|
+
sqlite3 (1.3.9)
|
|
193
253
|
sqlite3-ruby (1.3.3)
|
|
194
254
|
sqlite3 (>= 1.3.3)
|
|
195
255
|
stringex (1.5.1)
|
|
196
|
-
thor (0.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
256
|
+
thor (0.14.6)
|
|
257
|
+
tzinfo (0.3.41)
|
|
258
|
+
uuidtools (2.1.5)
|
|
259
|
+
zip (2.0.2)
|
|
200
260
|
|
|
201
261
|
PLATFORMS
|
|
262
|
+
java
|
|
202
263
|
ruby
|
|
203
264
|
|
|
204
265
|
DEPENDENCIES
|
|
205
266
|
activerecord
|
|
267
|
+
activerecord-mysql2-adapter
|
|
206
268
|
bson_ext
|
|
207
269
|
bundler
|
|
208
270
|
couch_potato
|
|
@@ -211,17 +273,21 @@ DEPENDENCIES
|
|
|
211
273
|
dm-migrations
|
|
212
274
|
dm-sqlite-adapter
|
|
213
275
|
guard-rspec
|
|
214
|
-
jeweler
|
|
215
276
|
json_pure
|
|
216
277
|
mongo_ext
|
|
217
278
|
mongo_mapper
|
|
218
279
|
mongoid
|
|
280
|
+
mongoid-tree
|
|
281
|
+
moped
|
|
219
282
|
mysql (~> 2.8.1)
|
|
220
283
|
mysql2
|
|
284
|
+
neo4j-core
|
|
221
285
|
ohm (~> 0.1.3)
|
|
222
286
|
pg
|
|
223
287
|
rake
|
|
224
288
|
rspec-rails
|
|
289
|
+
ruby-debug
|
|
290
|
+
ruby-debug19
|
|
225
291
|
sequel (~> 3.21.0)
|
|
226
292
|
sqlite3
|
|
227
293
|
sqlite3-ruby
|
data/History.rdoc
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
== Development (master)
|
|
2
|
+
|
|
3
|
+
=== New Features/Changes
|
|
4
|
+
* Using the deletion strategy with Mysql now only deletes those tables
|
|
5
|
+
which have had records added to them. (@MadRabbit)
|
|
6
|
+
* Add support for `pre_count` on Sequel with Mysql. (@vrinek)
|
|
7
|
+
* Add support for neo4j. (@dpisarewski)
|
|
8
|
+
* Cache collection names in mongo's truncation strategy. (@nyarly)
|
|
9
|
+
* Support for mongoid multiple connections. (@nyarly)
|
|
10
|
+
* Support for deletion with Sequel. (@cyberdelia)
|
|
11
|
+
|
|
12
|
+
=== Bug Fixes
|
|
13
|
+
* Fix `undefined method error` with DataMapper SQLite adaptor. (@lanej)
|
|
14
|
+
* Fully define Mysql2 adaptor constant. (@jgonera)
|
|
15
|
+
* Don't truncate schema tables in Postgres. (@billywatson)
|
|
16
|
+
* Fix issue #284. (@MartinNowak)
|
|
17
|
+
|
|
1
18
|
== 1.3.0 2014-05-23
|
|
2
19
|
|
|
3
20
|
=== New Features/Changes
|
|
4
|
-
* Introduced `
|
|
21
|
+
* Introduced `DatabaseCleaner::cleaning` method that takes a block. (@ethco)
|
|
5
22
|
* Improved Sequel support and added more tests (@ethco, @rhunter)
|
|
6
23
|
|
|
7
24
|
=== Bug Fixes
|
data/README.markdown
CHANGED
|
@@ -7,7 +7,7 @@ Each strategy is a small amount of code but is code that is usually needed in an
|
|
|
7
7
|
|
|
8
8
|
ActiveRecord, DataMapper, Sequel, MongoMapper, Mongoid, CouchPotato, Ohm and Redis are supported.
|
|
9
9
|
|
|
10
|
-
[](https://travis-ci.org/DatabaseCleaner/database_cleaner)
|
|
11
11
|
|
|
12
12
|
Here is an overview of the strategies supported for each library:
|
|
13
13
|
|
|
@@ -67,9 +67,17 @@ Here is an overview of the strategies supported for each library:
|
|
|
67
67
|
<td>No</td>
|
|
68
68
|
<td>No</td>
|
|
69
69
|
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td>Neo4j</td>
|
|
72
|
+
<td>Yes</td>
|
|
73
|
+
<td>Yes*</td>
|
|
74
|
+
<td>Yes*</td>
|
|
75
|
+
</tr>
|
|
70
76
|
</tbody>
|
|
71
77
|
</table>
|
|
72
78
|
|
|
79
|
+
* Truncation and Deletion strategies for Neo4j will just delete all nodes and relationships from the database.
|
|
80
|
+
|
|
73
81
|
<table>
|
|
74
82
|
<tbody>
|
|
75
83
|
<tr>
|
|
@@ -333,6 +341,11 @@ Usage beyond that remains the same with `DatabaseCleaner.start` calling any setu
|
|
|
333
341
|
<td><code>DatabaseCleaner[:ohm]</code></td>
|
|
334
342
|
<td>Connection specified as Redis URI</td>
|
|
335
343
|
</tr>
|
|
344
|
+
<tr>
|
|
345
|
+
<td>Neo4j</td>
|
|
346
|
+
<td><code>DatabaseCleaner[:neo4j]</code></td>
|
|
347
|
+
<td>Database type and path(URI) <code>DatabaseCleaner[:neo4j, connection: {type: :server_db, path: 'http://localhost:7475'}].</code></td>
|
|
348
|
+
</tr>
|
|
336
349
|
</tbody>
|
|
337
350
|
</table>
|
|
338
351
|
|
|
@@ -359,15 +372,39 @@ DatabaseCleaner[:mongoid].strategy = :truncation
|
|
|
359
372
|
|
|
360
373
|
### STDERR is being flooded when using Postgres
|
|
361
374
|
|
|
362
|
-
If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages).
|
|
375
|
+
If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages).
|
|
376
|
+
|
|
377
|
+
To silence these warnings set the following log level in your `postgresql.conf` file:
|
|
363
378
|
|
|
364
379
|
```ruby
|
|
365
380
|
client_min_messages = warning
|
|
366
381
|
```
|
|
367
382
|
|
|
383
|
+
For ActiveRecord, you add the following parameter in your database.yml file:
|
|
384
|
+
|
|
385
|
+
<pre>
|
|
386
|
+
test:
|
|
387
|
+
adapter: postgresql
|
|
388
|
+
# ...
|
|
389
|
+
min_messages: WARNING
|
|
390
|
+
</pre>
|
|
391
|
+
|
|
368
392
|
### Nothing happens in JRuby with Sequel using transactions
|
|
369
393
|
|
|
370
|
-
Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers.
|
|
394
|
+
Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers.
|
|
395
|
+
|
|
396
|
+
### Model fails to load with Neo4j using transactions
|
|
397
|
+
|
|
398
|
+
When you are using [neo4j](https://github.com/neo4jrb/neo4j) gem it creates schema and reads indexes upon loading models. These operations can't be done during a transaction. You have to preload your models before DatabaseCleaner starts a transaction.
|
|
399
|
+
|
|
400
|
+
Add to your rails_helper or spec_helper after requiring database_cleaner:
|
|
401
|
+
|
|
402
|
+
```ruby
|
|
403
|
+
require 'database_cleaner'
|
|
404
|
+
Dir["#{Rails.root}/app/models/**/*.rb"].each do |model|
|
|
405
|
+
load model
|
|
406
|
+
end
|
|
407
|
+
```
|
|
371
408
|
|
|
372
409
|
## Debugging
|
|
373
410
|
|
|
@@ -382,4 +419,4 @@ DatabaseCleaner.logger = Rails.logger
|
|
|
382
419
|
|
|
383
420
|
## COPYRIGHT
|
|
384
421
|
|
|
385
|
-
Copyright (c)
|
|
422
|
+
Copyright (c) 2014 Ben Mabey. See LICENSE for details.
|