packs-rails-minitest 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/lib/packs/rails/minitest/version.rb +1 -1
- data/lib/tasks/packs/test.rake +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33289367f34dd0f850b82b3a7630ed59a8d13baac106e2b0da5d937bd4be211b
|
4
|
+
data.tar.gz: 6ac5cc2a020bad866dd06e9b41f890a8172dab7b292be0251f6e04b1e6047751
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0ece2ad345375fbb1f03ae6665061d272973a2ba00b8659e14e66b4d1dac3d9f2f40cc9488cf6e12fd760d96cd496515b4f3d5003263265961244081f8d7d1d
|
7
|
+
data.tar.gz: 368bef89616a98172e4b97e4bdad018325d4c24712667b194a7792e21386ca1cb0d93a07e20fa5991d72e8c300f908b3cab7c4d12419195a51e83c8d1b1d89d5
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Packs::Rails::Minitest
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/packs-rails-minitest.svg)](https://badge.fury.io/rb/packs-rails-minitest)
|
4
|
+
|
3
5
|
Adds Rake tasks for testing [packs](https://github.com/rubyatscale/packs) using minitest.
|
4
6
|
|
5
7
|
## Installation
|
@@ -40,13 +42,19 @@ The environment variables should be set to values returned by the following Ruby
|
|
40
42
|
|
41
43
|
| Variable | Ruby |
|
42
44
|
|----------------------|--------------------------------------------------------------------------------------|
|
43
|
-
| DEFAULT_TEST | `"{.,#{Packs.all.map(&:relative_path).join(",")}/test/**/*_test.rb
|
44
|
-
| DEFAULT_TEST_EXCLUDE | `"{.,#{Packs.all.map(&:relative_path).join(",")}/test/{system,dummy}/**/*_test.rb
|
45
|
+
| DEFAULT_TEST | `"{.,#{Packs.all.map(&:relative_path).join(",")}}/test/**/*_test.rb"` |
|
46
|
+
| DEFAULT_TEST_EXCLUDE | `"{.,#{Packs.all.map(&:relative_path).join(",")}}/test/{system,dummy}/**/*_test.rb"` |
|
45
47
|
|
46
48
|
How you set this up is up to you, there isn't really a standard place. In `application.rb` or `boot.rb` work, just make
|
47
49
|
sure you only set it if it is not already set, otherwise the Rake tasks defined in this package may not work.
|
48
50
|
|
49
|
-
|
51
|
+
You'll also need to make sure the prepare tasks are run as part of `test:prepare`, e.g.:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
Rake::Task["test:prepare"].enhance(["packs:test:prepare"])
|
55
|
+
```
|
56
|
+
|
57
|
+
#### Rake tasks
|
50
58
|
|
51
59
|
Appropriate Rake tasks will be defined for you by setting `config.packs_rails_minitest.override_tasks = true` in
|
52
60
|
your `application.rb`. If you only include this gem in specific environments you will need to set it conditionally e.g.
|
@@ -55,6 +63,8 @@ your `application.rb`. If you only include this gem in specific environments you
|
|
55
63
|
config.packs_rails_minitest.override_tasks = true if Rails.env.development? || Rails.env.test?
|
56
64
|
```
|
57
65
|
|
66
|
+
Remember that you must use `rake test` instead of `rails test` for this to work.
|
67
|
+
|
58
68
|
## Contributing
|
59
69
|
|
60
70
|
Contributions are welcome, simply create a pull request or file an issue.
|
data/lib/tasks/packs/test.rake
CHANGED
@@ -43,18 +43,22 @@ if Rails.configuration.packs_rails_minitest.override_tasks
|
|
43
43
|
Rake::Task["test:all"]&.clear
|
44
44
|
Rake::Task["test:system"]&.clear
|
45
45
|
|
46
|
-
multitask test: ["test:prepare", "packs:test:prepare"] do
|
46
|
+
multitask test: ["test:prepare", "packs:test:prepare"] do |_, args|
|
47
47
|
ENV["DEFAULT_TEST"] = "{.,#{Packs.all.map(&:relative_path).join(",")}}/test/**/*_test.rb"
|
48
48
|
ENV["DEFAULT_TEST_EXCLUDE"] = "{.,#{Packs.all.map(&:relative_path).join(",")}}/test/{system,dummy}/**/*_test.rb"
|
49
|
-
|
49
|
+
if ENV.key? "TEST"
|
50
|
+
system("rails", "test", ENV["TEST"])
|
51
|
+
else
|
52
|
+
system("rails", "test")
|
53
|
+
end
|
50
54
|
end
|
51
55
|
|
52
56
|
namespace :test do
|
53
|
-
multitask all: [:prepare, "packs:test:prepare"] do
|
57
|
+
multitask all: [:prepare, "packs:test:prepare"] do |_, args|
|
54
58
|
system("rails", "test", "test/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/**/*_test.rb").to_s })
|
55
59
|
end
|
56
60
|
|
57
|
-
multitask system: [:prepare, "packs:test:prepare"] do
|
61
|
+
multitask system: [:prepare, "packs:test:prepare"] do |_, args|
|
58
62
|
system("rails", "test", "test/system/**/*_test.rb", *Packs.all.map { |pack| pack.relative_path.join("test/system/**/*_test.rb").to_s })
|
59
63
|
end
|
60
64
|
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.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: packs
|