database_cleaner 0.9.1 → 1.0.0.RC1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +127 -136
- data/History.txt +19 -1
- data/README.markdown +335 -0
- data/VERSION.yml +5 -5
- data/examples/Gemfile +18 -9
- data/examples/Gemfile.lock +127 -136
- data/examples/features/support/env.rb +3 -12
- data/lib/database_cleaner/active_record/base.rb +9 -9
- data/lib/database_cleaner/active_record/deletion.rb +5 -48
- data/lib/database_cleaner/active_record/transaction.rb +31 -9
- data/lib/database_cleaner/active_record/truncation.rb +23 -6
- data/lib/database_cleaner/data_mapper/truncation.rb +6 -2
- data/lib/database_cleaner/sequel/truncation.rb +1 -1
- data/spec/database_cleaner/active_record/base_spec.rb +32 -11
- data/spec/database_cleaner/active_record/transaction_spec.rb +101 -42
- data/spec/database_cleaner/active_record/truncation_spec.rb +1 -1
- metadata +28 -331
- data/README.textile +0 -247
data/VERSION.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
---
|
2
|
-
:minor:
|
3
|
-
:build:
|
4
|
-
:patch:
|
5
|
-
:major:
|
1
|
+
---
|
2
|
+
:minor: 0
|
3
|
+
:build: RC1
|
4
|
+
:patch: 0
|
5
|
+
:major: 1
|
data/examples/Gemfile
CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
|
|
3
3
|
|
4
4
|
group :development do
|
5
5
|
gem "rake"
|
6
|
-
gem "ruby-debug"
|
6
|
+
#gem "ruby-debug"
|
7
7
|
|
8
8
|
gem "bundler"
|
9
9
|
gem "jeweler"
|
@@ -12,9 +12,9 @@ group :development do
|
|
12
12
|
|
13
13
|
#ORM's
|
14
14
|
gem "activerecord"
|
15
|
-
gem "datamapper"
|
16
|
-
gem "dm-migrations"
|
17
|
-
gem "dm-sqlite-adapter"
|
15
|
+
gem "datamapper"
|
16
|
+
gem "dm-migrations"
|
17
|
+
gem "dm-sqlite-adapter"
|
18
18
|
gem "mongoid"
|
19
19
|
gem "tzinfo"
|
20
20
|
gem "mongo_ext"
|
@@ -23,7 +23,7 @@ group :development do
|
|
23
23
|
gem "couch_potato"
|
24
24
|
gem "sequel", "~>3.21.0"
|
25
25
|
#gem "ibm_db" # I don't want to add this dependency, even as a dev one since it requires DB2 to be installed
|
26
|
-
gem 'mysql'
|
26
|
+
gem 'mysql', '~> 2.8.1'
|
27
27
|
gem 'mysql2'
|
28
28
|
gem 'pg'
|
29
29
|
|
@@ -32,12 +32,21 @@ end
|
|
32
32
|
|
33
33
|
group :test do
|
34
34
|
gem "rspec-rails"
|
35
|
-
gem "rspactor"
|
36
|
-
gem "rcov"
|
37
|
-
gem "ZenTest"
|
35
|
+
#gem "rspactor"
|
36
|
+
#gem "rcov"
|
37
|
+
#gem "ZenTest"
|
38
38
|
end
|
39
39
|
|
40
40
|
group :cucumber do
|
41
41
|
gem "cucumber"
|
42
|
-
|
42
|
+
end
|
43
|
+
|
44
|
+
platforms :mri_18 do
|
45
|
+
gem 'sqlite3-ruby', :group => :cucumber
|
46
|
+
#gem 'mysql', :group => :development
|
47
|
+
end
|
48
|
+
|
49
|
+
platforms :mri_19 do
|
50
|
+
gem 'sqlite3', :group => :cucumber
|
51
|
+
#gem 'mysql2', :group => :development
|
43
52
|
end
|
data/examples/Gemfile.lock
CHANGED
@@ -1,231 +1,222 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
activesupport (= 3.2.6)
|
4
|
+
actionpack (3.2.11)
|
5
|
+
activemodel (= 3.2.11)
|
6
|
+
activesupport (= 3.2.11)
|
8
7
|
builder (~> 3.0.0)
|
9
8
|
erubis (~> 2.7.0)
|
10
|
-
journey (~> 1.0.
|
9
|
+
journey (~> 1.0.4)
|
11
10
|
rack (~> 1.4.0)
|
12
11
|
rack-cache (~> 1.2)
|
13
12
|
rack-test (~> 0.6.1)
|
14
|
-
sprockets (~> 2.1
|
15
|
-
activemodel (3.2.
|
16
|
-
activesupport (= 3.2.
|
13
|
+
sprockets (~> 2.2.1)
|
14
|
+
activemodel (3.2.11)
|
15
|
+
activesupport (= 3.2.11)
|
17
16
|
builder (~> 3.0.0)
|
18
|
-
activerecord (3.2.
|
19
|
-
activemodel (= 3.2.
|
20
|
-
activesupport (= 3.2.
|
17
|
+
activerecord (3.2.11)
|
18
|
+
activemodel (= 3.2.11)
|
19
|
+
activesupport (= 3.2.11)
|
21
20
|
arel (~> 3.0.2)
|
22
21
|
tzinfo (~> 0.3.29)
|
23
|
-
activesupport (3.2.
|
22
|
+
activesupport (3.2.11)
|
24
23
|
i18n (~> 0.6)
|
25
24
|
multi_json (~> 1.0)
|
26
25
|
addressable (2.2.8)
|
27
26
|
arel (3.0.2)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
bcrypt-ruby (3.0.1)
|
28
|
+
bson (1.8.2)
|
29
|
+
bson_ext (1.8.2)
|
30
|
+
bson (~> 1.8.2)
|
31
|
+
builder (3.0.4)
|
32
|
+
coderay (1.0.8)
|
33
|
+
couch_potato (0.7.1)
|
34
34
|
activemodel
|
35
35
|
couchrest (>= 1.0.1)
|
36
|
-
json
|
37
|
-
couchrest (1.
|
38
|
-
|
39
|
-
|
40
|
-
rest-client (
|
36
|
+
json (~> 1.6)
|
37
|
+
couchrest (1.1.3)
|
38
|
+
mime-types (~> 1.15)
|
39
|
+
multi_json (~> 1.0)
|
40
|
+
rest-client (~> 1.6.1)
|
41
41
|
cucumber (1.2.1)
|
42
42
|
builder (>= 2.1.2)
|
43
43
|
diff-lcs (>= 1.1.3)
|
44
44
|
gherkin (~> 2.11.0)
|
45
45
|
json (>= 1.4.6)
|
46
|
-
data_objects (0.10.
|
46
|
+
data_objects (0.10.11)
|
47
47
|
addressable (~> 2.1)
|
48
|
-
datamapper (1.
|
49
|
-
dm-aggregates (
|
50
|
-
dm-constraints (
|
51
|
-
dm-core (
|
52
|
-
dm-
|
53
|
-
dm-
|
54
|
-
dm-
|
55
|
-
dm-
|
56
|
-
dm-
|
57
|
-
dm-
|
58
|
-
dm-validations (= 1.0.0)
|
48
|
+
datamapper (1.2.0)
|
49
|
+
dm-aggregates (~> 1.2.0)
|
50
|
+
dm-constraints (~> 1.2.0)
|
51
|
+
dm-core (~> 1.2.0)
|
52
|
+
dm-migrations (~> 1.2.0)
|
53
|
+
dm-serializer (~> 1.2.0)
|
54
|
+
dm-timestamps (~> 1.2.0)
|
55
|
+
dm-transactions (~> 1.2.0)
|
56
|
+
dm-types (~> 1.2.0)
|
57
|
+
dm-validations (~> 1.2.0)
|
59
58
|
diff-lcs (1.1.3)
|
60
|
-
dm-aggregates (1.
|
61
|
-
dm-core (~> 1.
|
62
|
-
dm-constraints (1.
|
63
|
-
dm-core (~> 1.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
dm-core (~> 1.
|
71
|
-
dm-
|
72
|
-
dm-core (~> 1.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
dm-sqlite-adapter (1.
|
78
|
-
dm-do-adapter (~> 1.
|
79
|
-
do_sqlite3 (~> 0.10.
|
80
|
-
dm-timestamps (1.
|
81
|
-
dm-core (~> 1.
|
82
|
-
dm-transactions (1.
|
83
|
-
dm-core (~> 1.
|
84
|
-
dm-types (1.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
59
|
+
dm-aggregates (1.2.0)
|
60
|
+
dm-core (~> 1.2.0)
|
61
|
+
dm-constraints (1.2.0)
|
62
|
+
dm-core (~> 1.2.0)
|
63
|
+
dm-core (1.2.0)
|
64
|
+
addressable (~> 2.2.6)
|
65
|
+
dm-do-adapter (1.2.0)
|
66
|
+
data_objects (~> 0.10.6)
|
67
|
+
dm-core (~> 1.2.0)
|
68
|
+
dm-migrations (1.2.0)
|
69
|
+
dm-core (~> 1.2.0)
|
70
|
+
dm-serializer (1.2.2)
|
71
|
+
dm-core (~> 1.2.0)
|
72
|
+
fastercsv (~> 1.5)
|
73
|
+
json (~> 1.6)
|
74
|
+
json_pure (~> 1.6)
|
75
|
+
multi_json (~> 1.0)
|
76
|
+
dm-sqlite-adapter (1.2.0)
|
77
|
+
dm-do-adapter (~> 1.2.0)
|
78
|
+
do_sqlite3 (~> 0.10.6)
|
79
|
+
dm-timestamps (1.2.0)
|
80
|
+
dm-core (~> 1.2.0)
|
81
|
+
dm-transactions (1.2.0)
|
82
|
+
dm-core (~> 1.2.0)
|
83
|
+
dm-types (1.2.2)
|
84
|
+
bcrypt-ruby (~> 3.0)
|
85
|
+
dm-core (~> 1.2.0)
|
86
|
+
fastercsv (~> 1.5)
|
87
|
+
json (~> 1.6)
|
88
|
+
multi_json (~> 1.0)
|
89
|
+
stringex (~> 1.4)
|
90
|
+
uuidtools (~> 2.1)
|
91
|
+
dm-validations (1.2.0)
|
92
|
+
dm-core (~> 1.2.0)
|
93
|
+
do_sqlite3 (0.10.11)
|
94
|
+
data_objects (= 0.10.11)
|
94
95
|
erubis (2.7.0)
|
95
|
-
extlib (0.9.15)
|
96
96
|
fastercsv (1.5.5)
|
97
|
-
|
98
|
-
gherkin (2.11.1)
|
97
|
+
gherkin (2.11.5)
|
99
98
|
json (>= 1.4.6)
|
100
99
|
git (1.2.5)
|
101
|
-
guard (1.
|
102
|
-
listen (>= 0.
|
100
|
+
guard (1.6.1)
|
101
|
+
listen (>= 0.6.0)
|
102
|
+
lumberjack (>= 1.0.2)
|
103
|
+
pry (>= 0.9.10)
|
103
104
|
thor (>= 0.14.6)
|
104
|
-
guard-rspec (
|
105
|
+
guard-rspec (2.3.3)
|
105
106
|
guard (>= 1.1)
|
107
|
+
rspec (~> 2.11)
|
106
108
|
hike (1.2.1)
|
107
|
-
i18n (0.6.
|
109
|
+
i18n (0.6.1)
|
108
110
|
jeweler (1.8.4)
|
109
111
|
bundler (~> 1.0)
|
110
112
|
git (>= 1.2.5)
|
111
113
|
rake
|
112
114
|
rdoc
|
113
115
|
journey (1.0.4)
|
114
|
-
json (1.7.
|
115
|
-
json_pure (1.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
rb-fchange (~> 0.0.5)
|
120
|
-
rb-fsevent (~> 0.9.1)
|
121
|
-
rb-inotify (~> 0.8.8)
|
116
|
+
json (1.7.6)
|
117
|
+
json_pure (1.7.6)
|
118
|
+
listen (0.7.1)
|
119
|
+
lumberjack (1.0.2)
|
120
|
+
method_source (0.8.1)
|
122
121
|
mime-types (1.19)
|
123
|
-
mongo (1.
|
124
|
-
bson (~> 1.
|
122
|
+
mongo (1.8.2)
|
123
|
+
bson (~> 1.8.2)
|
125
124
|
mongo_ext (0.19.3)
|
126
|
-
mongo_mapper (0.
|
125
|
+
mongo_mapper (0.12.0)
|
127
126
|
activemodel (~> 3.0)
|
128
127
|
activesupport (~> 3.0)
|
129
|
-
plucky (~> 0.
|
130
|
-
mongoid (3.0.
|
128
|
+
plucky (~> 0.5.2)
|
129
|
+
mongoid (3.0.16)
|
131
130
|
activemodel (~> 3.1)
|
132
|
-
moped (~> 1.1
|
133
|
-
origin (~> 1.0
|
131
|
+
moped (~> 1.1)
|
132
|
+
origin (~> 1.0)
|
134
133
|
tzinfo (~> 0.3.22)
|
135
|
-
moped (1.
|
136
|
-
multi_json (1.
|
134
|
+
moped (1.3.2)
|
135
|
+
multi_json (1.5.0)
|
137
136
|
mysql (2.8.1)
|
138
137
|
mysql2 (0.3.11)
|
139
|
-
origin (1.0.
|
140
|
-
pg (0.14.
|
141
|
-
plucky (0.
|
138
|
+
origin (1.0.11)
|
139
|
+
pg (0.14.1)
|
140
|
+
plucky (0.5.2)
|
142
141
|
mongo (~> 1.5)
|
143
|
-
|
142
|
+
pry (0.9.10)
|
143
|
+
coderay (~> 1.0.5)
|
144
|
+
method_source (~> 0.8)
|
145
|
+
slop (~> 3.3.1)
|
146
|
+
rack (1.4.3)
|
144
147
|
rack-cache (1.2)
|
145
148
|
rack (>= 0.4)
|
146
149
|
rack-ssl (1.3.2)
|
147
150
|
rack
|
148
|
-
rack-test (0.6.
|
151
|
+
rack-test (0.6.2)
|
149
152
|
rack (>= 1.0)
|
150
|
-
railties (3.2.
|
151
|
-
actionpack (= 3.2.
|
152
|
-
activesupport (= 3.2.
|
153
|
+
railties (3.2.11)
|
154
|
+
actionpack (= 3.2.11)
|
155
|
+
activesupport (= 3.2.11)
|
153
156
|
rack-ssl (~> 1.3.2)
|
154
157
|
rake (>= 0.8.7)
|
155
158
|
rdoc (~> 3.4)
|
156
159
|
thor (>= 0.14.6, < 2.0)
|
157
|
-
rake (0.
|
158
|
-
rb-fchange (0.0.5)
|
159
|
-
ffi
|
160
|
-
rb-fsevent (0.9.1)
|
161
|
-
rb-inotify (0.8.8)
|
162
|
-
ffi (>= 0.5.0)
|
163
|
-
rbx-require-relative (0.0.9)
|
164
|
-
rcov (1.0.0)
|
160
|
+
rake (10.0.3)
|
165
161
|
rdoc (3.12)
|
166
162
|
json (~> 1.4)
|
167
163
|
rest-client (1.6.7)
|
168
164
|
mime-types (>= 1.16)
|
169
|
-
|
170
|
-
|
171
|
-
rspec-
|
172
|
-
rspec-
|
173
|
-
|
174
|
-
rspec-
|
175
|
-
rspec-expectations (2.11.1)
|
165
|
+
rspec (2.12.0)
|
166
|
+
rspec-core (~> 2.12.0)
|
167
|
+
rspec-expectations (~> 2.12.0)
|
168
|
+
rspec-mocks (~> 2.12.0)
|
169
|
+
rspec-core (2.12.2)
|
170
|
+
rspec-expectations (2.12.1)
|
176
171
|
diff-lcs (~> 1.1.3)
|
177
|
-
rspec-mocks (2.
|
178
|
-
rspec-rails (2.
|
172
|
+
rspec-mocks (2.12.1)
|
173
|
+
rspec-rails (2.12.1)
|
179
174
|
actionpack (>= 3.0)
|
180
175
|
activesupport (>= 3.0)
|
181
176
|
railties (>= 3.0)
|
182
|
-
rspec (~> 2.
|
183
|
-
|
184
|
-
|
185
|
-
ruby-debug-base (~> 0.10.4.0)
|
186
|
-
ruby-debug-base (0.10.4)
|
187
|
-
linecache (>= 0.3)
|
177
|
+
rspec-core (~> 2.12.0)
|
178
|
+
rspec-expectations (~> 2.12.0)
|
179
|
+
rspec-mocks (~> 2.12.0)
|
188
180
|
sequel (3.21.0)
|
189
|
-
|
181
|
+
slop (3.3.3)
|
182
|
+
sprockets (2.2.2)
|
190
183
|
hike (~> 1.2)
|
184
|
+
multi_json (~> 1.0)
|
191
185
|
rack (~> 1.0)
|
192
186
|
tilt (~> 1.1, != 1.3.0)
|
193
187
|
sqlite3 (1.3.6)
|
194
188
|
sqlite3-ruby (1.3.3)
|
195
189
|
sqlite3 (>= 1.3.3)
|
196
|
-
stringex (1.1
|
197
|
-
thor (0.
|
190
|
+
stringex (1.5.1)
|
191
|
+
thor (0.16.0)
|
198
192
|
tilt (1.3.3)
|
199
|
-
tzinfo (0.3.
|
193
|
+
tzinfo (0.3.35)
|
200
194
|
uuidtools (2.1.3)
|
201
195
|
|
202
196
|
PLATFORMS
|
203
197
|
ruby
|
204
198
|
|
205
199
|
DEPENDENCIES
|
206
|
-
ZenTest
|
207
200
|
activerecord
|
208
201
|
bson_ext
|
209
202
|
bundler
|
210
203
|
couch_potato
|
211
204
|
cucumber
|
212
|
-
datamapper
|
213
|
-
dm-migrations
|
214
|
-
dm-sqlite-adapter
|
205
|
+
datamapper
|
206
|
+
dm-migrations
|
207
|
+
dm-sqlite-adapter
|
215
208
|
guard-rspec
|
216
209
|
jeweler
|
217
210
|
json_pure
|
218
211
|
mongo_ext
|
219
212
|
mongo_mapper
|
220
213
|
mongoid
|
221
|
-
mysql
|
214
|
+
mysql (~> 2.8.1)
|
222
215
|
mysql2
|
223
216
|
pg
|
224
217
|
rake
|
225
|
-
rcov
|
226
|
-
rspactor
|
227
218
|
rspec-rails
|
228
|
-
ruby-debug
|
229
219
|
sequel (~> 3.21.0)
|
220
|
+
sqlite3
|
230
221
|
sqlite3-ruby
|
231
222
|
tzinfo
|
@@ -6,7 +6,7 @@ require 'bundler'
|
|
6
6
|
|
7
7
|
Bundler.setup
|
8
8
|
require 'rspec/expectations'
|
9
|
-
require 'ruby-debug'
|
9
|
+
#require 'ruby-debug'
|
10
10
|
|
11
11
|
DB_DIR = "#{File.dirname(__FILE__)}/../../db"
|
12
12
|
|
@@ -20,19 +20,10 @@ if orm && strategy
|
|
20
20
|
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
|
21
21
|
require 'database_cleaner'
|
22
22
|
require 'database_cleaner/cucumber'
|
23
|
-
|
24
|
-
begin
|
25
|
-
require "#{File.dirname(__FILE__)}/../../lib/#{orm.downcase}_models"
|
26
|
-
rescue LoadError => e
|
27
|
-
raise "You don't have the #{orm} ORM installed"
|
28
|
-
end
|
23
|
+
require "#{File.dirname(__FILE__)}/../../lib/#{orm.downcase}_models"
|
29
24
|
|
30
25
|
if another_orm
|
31
|
-
|
32
|
-
require "#{File.dirname(__FILE__)}/../../lib/#{another_orm.downcase}_models"
|
33
|
-
rescue LoadError => e
|
34
|
-
raise "You don't have the #{another_orm} ORM installed"
|
35
|
-
end
|
26
|
+
require "#{File.dirname(__FILE__)}/../../lib/#{another_orm.downcase}_models"
|
36
27
|
end
|
37
28
|
|
38
29
|
|