parallel_rspec 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel_rspec/tasks.rake +12 -2
- data/lib/parallel_rspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 789b0fec42e9fe3b485305a5da250915fab02f89678dba1171ec7fd2d7b0bcc5
|
4
|
+
data.tar.gz: 259d48bbffa5177861d88cf92daa4a9b942e4d40d21dff4d04ee3eb190a49dde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5da7ba542f13faacb9d89906b23255c02262e228b3cfa4c72377f0f0a1addfabfcb1c6970e6c15316e4a569f4ed15b28592ce11b0cbad522b7342c67f97ed13
|
7
|
+
data.tar.gz: 4a1eac0dfaa95d8ef167380ec9922072dee901e2e9087c0c9f00b121b34dde73cd148dada9c435bf51d98cb5f6547eaf31f5aa61e9b9effa8de148843f7ee122
|
@@ -5,14 +5,24 @@ db_namespace = namespace :db do
|
|
5
5
|
desc "Creates the test databases"
|
6
6
|
task :create => [:load_config] do
|
7
7
|
ParallelRSpec::Workers.new.run_test_workers do |worker|
|
8
|
-
|
8
|
+
if ActiveRecord::Base.configurations.respond_to?(:configs_for)
|
9
|
+
ActiveRecord::Base.configurations.configs_for(env_name: 'test').each do |configuration|
|
10
|
+
ActiveRecord::Tasks::DatabaseTasks.create configuration
|
11
|
+
end
|
12
|
+
else
|
13
|
+
ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations['test']
|
14
|
+
end
|
9
15
|
end
|
10
16
|
end
|
11
17
|
|
12
18
|
desc "Empty the test databases"
|
13
19
|
task :purge => %w(environment load_config) do
|
14
20
|
ParallelRSpec::Workers.new.run_test_workers do |worker|
|
15
|
-
ActiveRecord::Tasks::DatabaseTasks.
|
21
|
+
if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:purge_current)
|
22
|
+
ActiveRecord::Tasks::DatabaseTasks.purge_current 'test'
|
23
|
+
else
|
24
|
+
ActiveRecord::Tasks::DatabaseTasks.purge ActiveRecord::Base.configurations['test']
|
25
|
+
end
|
16
26
|
end
|
17
27
|
end
|
18
28
|
|