standalone_migrations 5.2.2 → 5.2.3
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 +4 -4
- data/Gemfile +2 -2
- data/README.markdown +1 -0
- data/VERSION +1 -1
- data/spec/standalone_migrations/callbacks_spec.rb +4 -4
- data/spec/standalone_migrations/configurator_spec.rb +31 -33
- data/spec/standalone_migrations_spec.rb +48 -48
- data/standalone_migrations.gemspec +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 219a7433481076edbe318711aa0c867f957876fa
|
4
|
+
data.tar.gz: 4b0dee79a2d43daa7b49829438e04b5670767fe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 155dfb9ca6c264fc2b23c72f7d9aaada1097640eb7206cc01b3b1ca4cde2aa09d6631ef03b0cd4e4c85442ea720cbffb7fb6a06ec9429ba6cdb52dcd69afc86d
|
7
|
+
data.tar.gz: 1a3eab8e50448b2ac611b1af4224905929f3825321d9116344d1dad269eb8250468745637bfa8c41d7aa385ecec890ccde18f34db1cdc640d6493af45c85c0ca
|
data/Gemfile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rake', '
|
3
|
+
gem 'rake', '>= 10.0'
|
4
4
|
gem 'activerecord', ENV['AR'] ? ENV['AR'].split(",") : [">= 4.2.7", "< 5.2.0"]
|
5
5
|
gem 'railties', ENV['AR'] ? ENV['AR'].split(",") : [">= 4.2.7", "< 5.2.0"]
|
6
6
|
|
7
7
|
group :dev do
|
8
8
|
gem 'sqlite3'
|
9
|
-
gem 'rspec', '
|
9
|
+
gem 'rspec', '>= 2.99.0'
|
10
10
|
gem 'jeweler'
|
11
11
|
end
|
data/README.markdown
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.2.
|
1
|
+
5.2.3
|
@@ -7,11 +7,11 @@ module StandaloneMigrations
|
|
7
7
|
describe ".on_loaded" do
|
8
8
|
|
9
9
|
it "responds to on_loaded" do
|
10
|
-
StandaloneMigrations.
|
10
|
+
expect(StandaloneMigrations).to respond_to :on_loaded
|
11
11
|
end
|
12
12
|
|
13
13
|
it "responds to run_on_load_callbacks" do
|
14
|
-
StandaloneMigrations.
|
14
|
+
expect(StandaloneMigrations).to respond_to :run_on_load_callbacks
|
15
15
|
end
|
16
16
|
|
17
17
|
it "can pass a block do on_loaded" do
|
@@ -24,7 +24,7 @@ module StandaloneMigrations
|
|
24
24
|
# invoke the callbacks
|
25
25
|
StandaloneMigrations.run_on_load_callbacks
|
26
26
|
|
27
|
-
callback_was_called.
|
27
|
+
expect(callback_was_called).to be true
|
28
28
|
end
|
29
29
|
|
30
30
|
it "can pass multiple blocks to on_loaded" do
|
@@ -38,7 +38,7 @@ module StandaloneMigrations
|
|
38
38
|
|
39
39
|
StandaloneMigrations.run_on_load_callbacks
|
40
40
|
|
41
|
-
callback_count.
|
41
|
+
expect(callback_count).to eq(4)
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -6,13 +6,6 @@ module StandaloneMigrations
|
|
6
6
|
|
7
7
|
describe "environment yaml configuration loading" do
|
8
8
|
|
9
|
-
let(:env_hash) do
|
10
|
-
{
|
11
|
-
"development" => { "adapter" => "sqlite3", "database" => "db/development.sql" },
|
12
|
-
"test" => { "adapter" => "sqlite3", "database" => "db/test.sql" },
|
13
|
-
"production" => {"adapter" => "sqlite3", "database" => ":memory:" }
|
14
|
-
}
|
15
|
-
end
|
16
9
|
|
17
10
|
let(:env_hash_other_db) do
|
18
11
|
{
|
@@ -23,44 +16,49 @@ module StandaloneMigrations
|
|
23
16
|
end
|
24
17
|
|
25
18
|
before(:all) do
|
19
|
+
@env_hash = {
|
20
|
+
"development" => { "adapter" => "sqlite3", "database" => "db/development.sql" },
|
21
|
+
"test" => { "adapter" => "sqlite3", "database" => "db/test.sql" },
|
22
|
+
"production" => {"adapter" => "sqlite3", "database" => ":memory:" }
|
23
|
+
}
|
26
24
|
@original_dir = Dir.pwd
|
27
25
|
Dir.chdir( File.expand_path("../../", __FILE__) )
|
28
26
|
FileUtils.mkdir_p "tmp/db"
|
29
27
|
Dir.chdir "tmp"
|
30
28
|
File.open("db/config.yml", "w") do |f|
|
31
|
-
f.write env_hash.to_yaml
|
29
|
+
f.write @env_hash.to_yaml
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
35
33
|
it "load the specific environment config" do
|
36
34
|
config = Configurator.new.config_for(:development)
|
37
|
-
config.
|
35
|
+
expect(config).to eq(@env_hash["development"])
|
38
36
|
end
|
39
37
|
|
40
38
|
it "load the yaml with environment configurations" do
|
41
39
|
config = Configurator.new.config_for(:development)
|
42
|
-
config["database"].
|
40
|
+
expect(config["database"]).to eq("db/development.sql")
|
43
41
|
end
|
44
42
|
|
45
43
|
it "allow access the original configuration hash (for all environments)" do
|
46
|
-
Configurator.new.config_for_all.
|
44
|
+
expect(Configurator.new.config_for_all).to eq(@env_hash)
|
47
45
|
end
|
48
46
|
|
49
47
|
context "customizing the environments configuration dynamically" do
|
50
48
|
|
51
49
|
let(:configurator) { Configurator.new }
|
52
|
-
let(:new_config) { { 'sbrobous' => 'test' } }
|
53
50
|
|
54
51
|
before(:all) do
|
52
|
+
@new_config = { 'sbrobous' => 'test' }
|
55
53
|
Configurator.environments_config do |env|
|
56
54
|
env.on "production" do
|
57
|
-
new_config
|
55
|
+
@new_config
|
58
56
|
end
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
62
60
|
it "allow changes on the configuration hashes" do
|
63
|
-
configurator.config_for("production").
|
61
|
+
expect(configurator.config_for("production")).to eq(@new_config)
|
64
62
|
end
|
65
63
|
|
66
64
|
it "return current configuration if block yielding returns nil" do
|
@@ -69,13 +67,13 @@ module StandaloneMigrations
|
|
69
67
|
nil
|
70
68
|
end
|
71
69
|
end
|
72
|
-
configurator.config_for("production").
|
70
|
+
expect(configurator.config_for("production")).to eq(@new_config)
|
73
71
|
end
|
74
72
|
|
75
73
|
it "pass the current configuration as block argument" do
|
76
74
|
Configurator.environments_config do |env|
|
77
75
|
env.on "production" do |current_config|
|
78
|
-
current_config.
|
76
|
+
expect(current_config).to eq(@new_config)
|
79
77
|
end
|
80
78
|
end
|
81
79
|
end
|
@@ -95,19 +93,19 @@ module StandaloneMigrations
|
|
95
93
|
end
|
96
94
|
|
97
95
|
it "use config/database.yml" do
|
98
|
-
configurator.config.
|
96
|
+
expect(configurator.config).to eq('db/config.yml')
|
99
97
|
end
|
100
98
|
|
101
99
|
it "use db/migrate dir" do
|
102
|
-
configurator.migrate_dir.
|
100
|
+
expect(configurator.migrate_dir).to eq('db/migrate')
|
103
101
|
end
|
104
102
|
|
105
103
|
it "use db/seeds.rb" do
|
106
|
-
configurator.seeds.
|
104
|
+
expect(configurator.seeds).to eq("db/seeds.rb")
|
107
105
|
end
|
108
106
|
|
109
107
|
it "use db/schema.rb" do
|
110
|
-
configurator.schema.
|
108
|
+
expect(configurator.schema).to eq("db/schema.rb")
|
111
109
|
end
|
112
110
|
|
113
111
|
end
|
@@ -127,19 +125,19 @@ module StandaloneMigrations
|
|
127
125
|
end
|
128
126
|
|
129
127
|
it "use custom config" do
|
130
|
-
configurator.config.
|
128
|
+
expect(configurator.config).to eq(args[:config])
|
131
129
|
end
|
132
130
|
|
133
131
|
it "use custom migrate dir" do
|
134
|
-
configurator.migrate_dir.
|
132
|
+
expect(configurator.migrate_dir).to eq(args[:migrate_dir])
|
135
133
|
end
|
136
134
|
|
137
135
|
it "use custom seeds" do
|
138
|
-
configurator.seeds.
|
136
|
+
expect(configurator.seeds).to eq(args[:seeds])
|
139
137
|
end
|
140
138
|
|
141
139
|
it "use custom schema" do
|
142
|
-
configurator.schema.
|
140
|
+
expect(configurator.schema).to eq(args[:schema])
|
143
141
|
end
|
144
142
|
|
145
143
|
end
|
@@ -196,11 +194,11 @@ module StandaloneMigrations
|
|
196
194
|
end
|
197
195
|
|
198
196
|
it "look up named dot file" do
|
199
|
-
other_configurator.config.
|
197
|
+
expect(other_configurator.config).to eq(yaml_hash_other_db['config']['database'])
|
200
198
|
end
|
201
199
|
|
202
200
|
it "load config from named dot file" do
|
203
|
-
other_configurator.migrate_dir.
|
201
|
+
expect(other_configurator.migrate_dir).to eq('db2/migrate')
|
204
202
|
end
|
205
203
|
|
206
204
|
after(:all) do
|
@@ -224,33 +222,33 @@ module StandaloneMigrations
|
|
224
222
|
end
|
225
223
|
|
226
224
|
it "use default values for the missing configurations" do
|
227
|
-
configurator.migrate_dir.
|
225
|
+
expect(configurator.migrate_dir).to eq('db/migrate')
|
228
226
|
end
|
229
227
|
|
230
228
|
it "use custom config from file" do
|
231
|
-
configurator.config.
|
229
|
+
expect(configurator.config).to eq(yaml_hash["config"]["database"])
|
232
230
|
end
|
233
231
|
|
234
232
|
it "use custom config value from partial configuration" do
|
235
|
-
configurator.seeds.
|
233
|
+
expect(configurator.seeds).to eq(yaml_hash["db"]["seeds"])
|
236
234
|
end
|
237
235
|
|
238
236
|
end
|
239
237
|
|
240
238
|
it "use custom config from file" do
|
241
|
-
configurator.config.
|
239
|
+
expect(configurator.config).to eq(yaml_hash["config"]["database"])
|
242
240
|
end
|
243
241
|
|
244
242
|
it "use custom migrate dir from file" do
|
245
|
-
configurator.migrate_dir.
|
243
|
+
expect(configurator.migrate_dir).to eq(yaml_hash["db"]["migrate"])
|
246
244
|
end
|
247
245
|
|
248
246
|
it "use custom seeds from file" do
|
249
|
-
configurator.seeds.
|
247
|
+
expect(configurator.seeds).to eq(yaml_hash["db"]["seeds"])
|
250
248
|
end
|
251
249
|
|
252
250
|
it "use custom schema from file" do
|
253
|
-
configurator.schema.
|
251
|
+
expect(configurator.schema).to eq(yaml_hash["db"]["schema"])
|
254
252
|
end
|
255
253
|
|
256
254
|
after(:all) do
|
@@ -103,9 +103,9 @@ test:
|
|
103
103
|
|
104
104
|
it "warns of deprecated folder structure" do
|
105
105
|
warning = /DEPRECATED.* db\/migrate/
|
106
|
-
run("rake db:create").
|
106
|
+
expect(run("rake db:create")).not_to match(warning)
|
107
107
|
write('db/migrations/fooo.rb', 'xxx')
|
108
|
-
run("rake db:create --trace").
|
108
|
+
expect(run("rake db:create --trace")).to match(warning)
|
109
109
|
end
|
110
110
|
|
111
111
|
describe 'db:create and drop' do
|
@@ -117,14 +117,14 @@ test:
|
|
117
117
|
|
118
118
|
describe 'callbacks' do
|
119
119
|
it 'runs the callbacks' do
|
120
|
-
StandaloneMigrations::Tasks.
|
120
|
+
expect(StandaloneMigrations::Tasks).to receive(:configure)
|
121
121
|
|
122
122
|
connection_established = false
|
123
|
-
ActiveRecord::Base.
|
123
|
+
expect(ActiveRecord::Base).to receive(:establish_connection) do
|
124
124
|
connection_established = true
|
125
125
|
end
|
126
|
-
StandaloneMigrations.
|
127
|
-
connection_established.
|
126
|
+
expect(StandaloneMigrations).to receive(:run_on_load_callbacks) do
|
127
|
+
expect(connection_established).to be true
|
128
128
|
end
|
129
129
|
|
130
130
|
Dir.chdir(File.join(File.dirname(__FILE__), "tmp")) do
|
@@ -136,56 +136,56 @@ test:
|
|
136
136
|
|
137
137
|
describe 'db:new_migration' do
|
138
138
|
it "fails if i do not add a name" do
|
139
|
-
lambda{ run("rake db:new_migration") }.
|
139
|
+
expect(lambda{ run("rake db:new_migration") }).to raise_error(/name=/)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "generates a new migration with this name from ENV and timestamp" do
|
143
|
-
run("rake db:new_migration name=test_abc_env").
|
144
|
-
run("ls db/migrate").
|
143
|
+
expect(run("rake db:new_migration name=test_abc_env")).to match(%r{create(.*)db/migrate/\d+_test_abc_env\.rb})
|
144
|
+
expect(run("ls db/migrate")).to match(/^\d+_test_abc_env.rb$/)
|
145
145
|
end
|
146
146
|
|
147
147
|
it "generates a new migration with this name from args and timestamp" do
|
148
|
-
run("rake db:new_migration[test_abc_args]").
|
149
|
-
run("ls db/migrate").
|
148
|
+
expect(run("rake db:new_migration[test_abc_args]")).to match(%r{create(.*)db/migrate/\d+_test_abc_args\.rb})
|
149
|
+
expect(run("ls db/migrate")).to match(/^\d+_test_abc_args.rb$/)
|
150
150
|
end
|
151
151
|
|
152
152
|
it "generates a new migration with the name converted to the Rails migration format" do
|
153
|
-
run("rake db:new_migration name=MyNiceModel").
|
154
|
-
read(migration('my_nice_model')).
|
155
|
-
run("ls db/migrate").
|
153
|
+
expect(run("rake db:new_migration name=MyNiceModel")).to match(%r{create(.*)db/migrate/\d+_my_nice_model\.rb})
|
154
|
+
expect(read(migration('my_nice_model'))).to match(/class MyNiceModel/)
|
155
|
+
expect(run("ls db/migrate")).to match(/^\d+_my_nice_model.rb$/)
|
156
156
|
end
|
157
157
|
|
158
158
|
it "generates a new migration with name and options from ENV" do
|
159
159
|
run("rake db:new_migration name=add_name_and_email_to_users options='name:string email:string'")
|
160
|
-
read(migration('add_name_and_email_to_users')).
|
160
|
+
expect(read(migration('add_name_and_email_to_users'))).to match(/add_column :users, :name, :string\n\s*add_column :users, :email, :string/)
|
161
161
|
end
|
162
162
|
|
163
163
|
it "generates a new migration with name and options from args" do
|
164
164
|
run("rake db:new_migration[add_website_and_username_to_users,website:string/username:string]")
|
165
|
-
read(migration('add_website_and_username_to_users')).
|
165
|
+
expect(read(migration('add_website_and_username_to_users'))).to match(/add_column :users, :website, :string\n\s*add_column :users, :username, :string/)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
169
|
describe 'db:version' do
|
170
170
|
it "should start with a new database version" do
|
171
|
-
run("rake db:version").
|
171
|
+
expect(run("rake db:version")).to match(/Current version: 0/)
|
172
172
|
end
|
173
173
|
|
174
174
|
it "should display the current version" do
|
175
175
|
run("rake db:new_migration name=test_abc")
|
176
176
|
run("rake --trace db:migrate")
|
177
|
-
run("rake db:version").
|
177
|
+
expect(run("rake db:version")).to match(/Current version: #{Time.now.year}/)
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
181
181
|
describe 'db:migrate' do
|
182
182
|
it "does nothing when no migrations are present" do
|
183
|
-
run("rake db:migrate").
|
183
|
+
expect(run("rake db:migrate")).not_to match(/Migrating/)
|
184
184
|
end
|
185
185
|
|
186
186
|
it "migrates if i add a migration" do
|
187
187
|
run("rake db:new_migration name=xxx")
|
188
|
-
run("rake db:migrate").
|
188
|
+
expect(run("rake db:migrate")).to match(/Xxx: Migrating/i)
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -197,15 +197,15 @@ test:
|
|
197
197
|
run 'rake db:migrate'
|
198
198
|
|
199
199
|
result = run("rake db:migrate:down VERSION=#{version}")
|
200
|
-
result.
|
201
|
-
result.
|
200
|
+
expect(result).not_to match(/Xxx: reverting/)
|
201
|
+
expect(result).to match(/Yyy: reverting/)
|
202
202
|
end
|
203
203
|
|
204
204
|
it "fails without version" do
|
205
205
|
make_migration('yyy')
|
206
206
|
# Rails has a bug where it's sending a bad failure exception
|
207
207
|
# https://github.com/rails/rails/issues/28905
|
208
|
-
lambda{ run("rake db:migrate:down") }.
|
208
|
+
expect(lambda{ run("rake db:migrate:down") }).to raise_error(/VERSION|version/)
|
209
209
|
end
|
210
210
|
end
|
211
211
|
|
@@ -216,39 +216,39 @@ test:
|
|
216
216
|
sleep 1
|
217
217
|
version = make_migration('yyy')
|
218
218
|
result = run("rake db:migrate:up VERSION=#{version}")
|
219
|
-
result.
|
220
|
-
result.
|
219
|
+
expect(result).not_to match(/Xxx: migrating/)
|
220
|
+
expect(result).to match(/Yyy: migrating/)
|
221
221
|
end
|
222
222
|
|
223
223
|
it "fails without version" do
|
224
224
|
make_migration('yyy')
|
225
225
|
# Rails has a bug where it's sending a bad failure exception
|
226
226
|
# https://github.com/rails/rails/issues/28905
|
227
|
-
lambda{ run("rake db:migrate:up") }.
|
227
|
+
expect(lambda{ run("rake db:migrate:up") }).to raise_error(/VERSION|version/)
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
231
231
|
describe 'db:rollback' do
|
232
232
|
it "does nothing when no migrations have been run" do
|
233
|
-
run("rake db:version").
|
234
|
-
run("rake db:rollback").
|
235
|
-
run("rake db:version").
|
233
|
+
expect(run("rake db:version")).to match(/version: 0/)
|
234
|
+
expect(run("rake db:rollback")).to eq('')
|
235
|
+
expect(run("rake db:version")).to match(/version: 0/)
|
236
236
|
end
|
237
237
|
|
238
238
|
it "rolls back the last migration if one has been applied" do
|
239
239
|
write_multiple_migrations
|
240
240
|
run("rake db:migrate")
|
241
|
-
run("rake db:version").
|
242
|
-
run("rake db:rollback").
|
243
|
-
run("rake db:version").
|
241
|
+
expect(run("rake db:version")).to match(/version: 20100509095816/)
|
242
|
+
expect(run("rake db:rollback")).to match(/revert/)
|
243
|
+
expect(run("rake db:version")).to match(/version: 20100509095815/)
|
244
244
|
end
|
245
245
|
|
246
246
|
it "rolls back multiple migrations if the STEP argument is given" do
|
247
247
|
write_multiple_migrations
|
248
248
|
run("rake db:migrate")
|
249
|
-
run("rake db:version").
|
249
|
+
expect(run("rake db:version")).to match(/version: 20100509095816/)
|
250
250
|
run("rake db:rollback STEP=2") =~ /revert/
|
251
|
-
run("rake db:version").
|
251
|
+
expect(run("rake db:version")).to match(/version: 0/)
|
252
252
|
end
|
253
253
|
end
|
254
254
|
|
@@ -256,7 +256,7 @@ test:
|
|
256
256
|
it "dumps the schema" do
|
257
257
|
write('db/schema.rb', '')
|
258
258
|
run('rake db:schema:dump')
|
259
|
-
read('db/schema.rb').
|
259
|
+
expect(read('db/schema.rb')).to match(/ActiveRecord/)
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
@@ -266,7 +266,7 @@ test:
|
|
266
266
|
schema = "db/schema.rb"
|
267
267
|
write(schema, read(schema)+"\nputs 'LOADEDDD'")
|
268
268
|
result = run('rake db:schema:load')
|
269
|
-
result.
|
269
|
+
expect(result).to match(/LOADEDDD/)
|
270
270
|
end
|
271
271
|
|
272
272
|
it "loads all migrations" do
|
@@ -275,29 +275,29 @@ test:
|
|
275
275
|
run "rake db:drop"
|
276
276
|
run "rake db:create"
|
277
277
|
run "rake db:schema:load"
|
278
|
-
run( "rake db:migrate").strip.
|
278
|
+
expect(run( "rake db:migrate").strip).to eq('')
|
279
279
|
end
|
280
280
|
end
|
281
281
|
|
282
282
|
describe 'db:abort_if_pending_migrations' do
|
283
283
|
it "passes when no migrations are pending" do
|
284
|
-
run("rake db:abort_if_pending_migrations").strip.
|
284
|
+
expect(run("rake db:abort_if_pending_migrations").strip).to eq('')
|
285
285
|
end
|
286
286
|
|
287
287
|
it "fails when migrations are pending" do
|
288
288
|
make_migration('yyy')
|
289
|
-
lambda{ run("rake db:abort_if_pending_migrations") }.
|
289
|
+
expect(lambda{ run("rake db:abort_if_pending_migrations") }).to raise_error(/1 pending migration/)
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
293
|
describe 'db:test:load' do
|
294
294
|
it 'loads' do
|
295
295
|
write("db/schema.rb", "puts 'LOADEDDD'")
|
296
|
-
run("rake db:test:load").
|
296
|
+
expect(run("rake db:test:load")).to match(/LOADEDDD/)
|
297
297
|
end
|
298
298
|
|
299
299
|
it "fails without schema" do
|
300
|
-
lambda{ run("rake db:test:load") }.
|
300
|
+
expect(lambda{ run("rake db:test:load") }).to raise_error(/try again/)
|
301
301
|
end
|
302
302
|
end
|
303
303
|
|
@@ -310,7 +310,7 @@ test:
|
|
310
310
|
describe "db:seed" do
|
311
311
|
it "loads" do
|
312
312
|
write("db/seeds.rb", "puts 'LOADEDDD'")
|
313
|
-
run("rake db:seed").
|
313
|
+
expect(run("rake db:seed")).to match(/LOADEDDD/)
|
314
314
|
end
|
315
315
|
|
316
316
|
describe 'with non-default seed file' do
|
@@ -329,13 +329,13 @@ test:
|
|
329
329
|
|
330
330
|
it "loads" do
|
331
331
|
write("db/seeds2.rb", "puts 'LOADEDDD'")
|
332
|
-
run("rake db:seed").
|
332
|
+
expect(run("rake db:seed")).to match(/LOADEDDD/)
|
333
333
|
end
|
334
334
|
end
|
335
335
|
|
336
336
|
|
337
337
|
it "does nothing without seeds" do
|
338
|
-
run("rake db:seed").length.
|
338
|
+
expect(run("rake db:seed").length).to eq(0)
|
339
339
|
end
|
340
340
|
end
|
341
341
|
|
@@ -343,7 +343,7 @@ test:
|
|
343
343
|
it "should not error when a seeds file does not exist" do
|
344
344
|
make_migration('yyy')
|
345
345
|
run('rake db:migrate DB=test')
|
346
|
-
lambda{ run("rake db:reset") }.
|
346
|
+
expect(lambda{ run("rake db:reset") }).not_to raise_error
|
347
347
|
end
|
348
348
|
end
|
349
349
|
|
@@ -351,12 +351,12 @@ test:
|
|
351
351
|
it "runs when using the DB environment variable", :travis_error => true do
|
352
352
|
make_migration('yyy')
|
353
353
|
run('rake db:migrate RAILS_ENV=test')
|
354
|
-
run('rake db:version RAILS_ENV=test').
|
355
|
-
run('rake db:version').
|
354
|
+
expect(run('rake db:version RAILS_ENV=test')).not_to match(/version: 0/)
|
355
|
+
expect(run('rake db:version')).to match(/version: 0/)
|
356
356
|
end
|
357
357
|
|
358
358
|
it "should error on an invalid database", :travis_error => true do
|
359
|
-
lambda{ run("rake db:create RAILS_ENV=nonexistent")}.
|
359
|
+
expect(lambda{ run("rake db:create RAILS_ENV=nonexistent")}).to raise_error(/rake aborted/)
|
360
360
|
end
|
361
361
|
end
|
362
362
|
end
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: standalone_migrations 5.2.
|
5
|
+
# stub: standalone_migrations 5.2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "standalone_migrations"
|
9
|
-
s.version = "5.2.
|
9
|
+
s.version = "5.2.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Todd Huss", "Michael Grosser"]
|
14
|
-
s.date = "2017-06-
|
14
|
+
s.date = "2017-06-10"
|
15
15
|
s.email = "thuss@gabrito.com"
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE",
|
@@ -58,16 +58,16 @@ Gem::Specification.new do |s|
|
|
58
58
|
s.specification_version = 4
|
59
59
|
|
60
60
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_runtime_dependency(%q<rake>, ["
|
61
|
+
s.add_runtime_dependency(%q<rake>, [">= 10.0"])
|
62
62
|
s.add_runtime_dependency(%q<activerecord>, ["< 5.2.0", ">= 4.2.7"])
|
63
63
|
s.add_runtime_dependency(%q<railties>, ["< 5.2.0", ">= 4.2.7"])
|
64
64
|
else
|
65
|
-
s.add_dependency(%q<rake>, ["
|
65
|
+
s.add_dependency(%q<rake>, [">= 10.0"])
|
66
66
|
s.add_dependency(%q<activerecord>, ["< 5.2.0", ">= 4.2.7"])
|
67
67
|
s.add_dependency(%q<railties>, ["< 5.2.0", ">= 4.2.7"])
|
68
68
|
end
|
69
69
|
else
|
70
|
-
s.add_dependency(%q<rake>, ["
|
70
|
+
s.add_dependency(%q<rake>, [">= 10.0"])
|
71
71
|
s.add_dependency(%q<activerecord>, ["< 5.2.0", ">= 4.2.7"])
|
72
72
|
s.add_dependency(%q<railties>, ["< 5.2.0", ">= 4.2.7"])
|
73
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standalone_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Huss
|
@@ -9,20 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-06-
|
12
|
+
date: 2017-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '10.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '10.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|