packs-rails-minitest 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33289367f34dd0f850b82b3a7630ed59a8d13baac106e2b0da5d937bd4be211b
4
- data.tar.gz: 6ac5cc2a020bad866dd06e9b41f890a8172dab7b292be0251f6e04b1e6047751
3
+ metadata.gz: '096f9352f62c9c220cd67c01cd64df1d36860e76c2c4ef8fc661163d0be58edd'
4
+ data.tar.gz: 58bc4532e0107064c941464b7fb7e499e49a399b9dceb2ac56b6cfba2324c0b9
5
5
  SHA512:
6
- metadata.gz: a0ece2ad345375fbb1f03ae6665061d272973a2ba00b8659e14e66b4d1dac3d9f2f40cc9488cf6e12fd760d96cd496515b4f3d5003263265961244081f8d7d1d
7
- data.tar.gz: 368bef89616a98172e4b97e4bdad018325d4c24712667b194a7792e21386ca1cb0d93a07e20fa5991d72e8c300f908b3cab7c4d12419195a51e83c8d1b1d89d5
6
+ metadata.gz: 7c317a94d61bbd85c8490f04d75d92ebe4a16311f24dc53637d2527ecda3bf8735e9f529155e7634d21b40f5c8a973238dd9755be3abcfdda752e2d848360f81
7
+ data.tar.gz: ef9f7e1828dcae3dee7d0f874b91a86db4bd46eaeff65d2eca9a3c4c05c56363f39e354ab7324ce90ad9a7abfcd74e764aab4af14a7169cf6bbaa8b4de34a178
@@ -1,7 +1,7 @@
1
1
  module Packs
2
2
  module Rails
3
3
  module Minitest
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
@@ -1,38 +1,39 @@
1
+ run_tests = ->(*args) do
2
+ opts = ENV.key?("TESTOPTS") ? ENV["TESTOPTS"].shellsplit : []
3
+ system("rails", "test", *args, *opts) || exit($?.exitstatus)
4
+ end
5
+
1
6
  namespace :packs do
7
+
2
8
  task test: "test:prepare" do
3
9
  ENV["DEFAULT_TEST"] = "{#{Packs.all.map(&:relative_path).join(",")}}/test/**/*_test.rb"
4
10
  ENV["DEFAULT_TEST_EXCLUDE"] = "{#{Packs.all.map(&:relative_path).join(",")}}/test/{system,dummy}/**/*_test.rb"
5
- system("rails", "test")
11
+ run_tests.call
6
12
  end
7
13
 
8
14
  namespace :test do
9
15
  multitask prepare: Packs.all.map { |pack| "#{pack.name}:prepare" }
10
16
 
11
17
  task all: :prepare do
12
- system("rails", "test", *Packs.all.map { |pack| pack.relative_path.join("test/**/*_test.rb").to_s })
18
+ run_tests.call(*Packs.all.map { |pack| pack.relative_path.join("test/**/*_test.rb").to_s })
13
19
  end
14
20
 
15
21
  task system: :prepare do
16
- system("rails", "test", *Packs.all.map { |pack| pack.relative_path.join("test/system/**/*_test.rb").to_s })
22
+ run_tests.call(*Packs.all.map { |pack| pack.relative_path.join("test/system/**/*_test.rb").to_s })
17
23
  end
18
24
 
19
25
  Packs.all.each do |pack|
20
26
  task pack.name => "#{pack.name}:prepare" do
21
27
  ENV["DEFAULT_TEST"] = pack.relative_path.join("test/**/*_test.rb").to_s
22
28
  ENV["DEFAULT_TEST_EXCLUDE"] = pack.relative_path.join("test/{system,dummy}/**/*_test.rb").to_s
23
- system("rails", "test")
29
+ run_tests.call
24
30
  end
25
31
 
26
32
  namespace pack.name do
27
33
  multitask :prepare
28
34
 
29
- task all: :prepare do
30
- system("rails", "test", pack.relative_path.join("test/**/*_test.rb").to_s)
31
- end
32
-
33
- task system: :prepare do
34
- system("rails", "test", pack.relative_path.join("test/system/**/*_test.rb").to_s)
35
- end
35
+ task(all: :prepare) { run_tests.call(pack.relative_path.join("test/**/*_test.rb").to_s) }
36
+ task(system: :prepare) { run_tests.call(pack.relative_path.join("test/system/**/*_test.rb").to_s) }
36
37
  end
37
38
  end
38
39
  end
@@ -47,19 +48,19 @@ if Rails.configuration.packs_rails_minitest.override_tasks
47
48
  ENV["DEFAULT_TEST"] = "{.,#{Packs.all.map(&:relative_path).join(",")}}/test/**/*_test.rb"
48
49
  ENV["DEFAULT_TEST_EXCLUDE"] = "{.,#{Packs.all.map(&:relative_path).join(",")}}/test/{system,dummy}/**/*_test.rb"
49
50
  if ENV.key? "TEST"
50
- system("rails", "test", ENV["TEST"])
51
+ run_tests.call(ENV["TEST"])
51
52
  else
52
- system("rails", "test")
53
+ run_tests.call
53
54
  end
54
55
  end
55
56
 
56
57
  namespace :test do
57
58
  multitask all: [:prepare, "packs:test:prepare"] do |_, args|
58
- system("rails", "test", "test/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/**/*_test.rb").to_s })
59
+ run_tests.call("test/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/**/*_test.rb").to_s })
59
60
  end
60
61
 
61
62
  multitask system: [:prepare, "packs:test:prepare"] do |_, args|
62
- system("rails", "test", "test/system/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/system/**/*_test.rb").to_s })
63
+ run_tests.call("test/system/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/system/**/*_test.rb").to_s })
63
64
  end
64
65
  end
65
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packs-rails-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graham Rogers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: packs