hanami-minitest 3.0.0 → 3.1.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca04ed88be7b43328135fcb60b8c5f8fa04c27b3a051b30c828c0234ad9799b3
4
- data.tar.gz: 04aa896a94262f0117af46cbac9b5da95b9d0a6ef3f401474a3ee8ecc0e8fbeb
3
+ metadata.gz: c8351480bc21008efe0cf228c0c76b913778413451c3d988feef10a717e08314
4
+ data.tar.gz: 537e4d33537d4b9870b91eacc0e05eaa0cc80b2e3d747f365fca86793f66cd13
5
5
  SHA512:
6
- metadata.gz: c0d28fba6c1cc7edb6a67e2d2697733cebdc4274018df9712b39619a2bbcf0d788f8748e22a9b4feee81c6ee82960980aa74437379b110a9cad244cd87cd8f61
7
- data.tar.gz: f896b458d7aec6a39e04a8cd1f9d88083210ece3da736cdd792dfb2e05ead8451c63ca116270373bf989c8ca7bc2586d9d88bf6fa3b75616692e1a6eaa6f8e78
6
+ metadata.gz: 6196bf424364b4dc0b1c4eb0397122f3c01208d6f4cdf3d793db06802a025b16031325c1b1d6d053c9f2ff16b59e132fc10d87ce6fd1c0981a17001aa5c5bd5a
7
+ data.tar.gz: 57193a9f1504cc71cc57976744d790343fad7ae6c5b9ced17b0e36e41b2297d3c620ae63f1fdc687e061bcf24e742f66acd376d0b0e3f9c6d1fe0a4a972c3d6d
data/CHANGELOG.md CHANGED
@@ -19,7 +19,20 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
19
19
 
20
20
  ### Security
21
21
 
22
- [Unreleased]: https://github.com/hanami/hanami-minitest/compare/v3.0.0...HEAD
22
+ [Unreleased]: https://github.com/hanami/hanami-minitest/compare/v3.1.0.rc1...HEAD
23
+
24
+ ## [3.1.0.rc1] - 2026-11-27
25
+
26
+ ### Changed
27
+
28
+ - Declare the `--skip-tests` option for each `hanami generate` command that hanami-minitest hooks into, using Dry CLI's `Registry#option`. hanami-minitest no longer depends on hanami-cli to declare this option. (@timriley in #12)
29
+
30
+ ### Fixed
31
+
32
+ - Generate `FeatureTest` and `RequestTest` classes so feature and request tests work as expected without configuration. (@mddelk in #9, #10)
33
+ - Use the app's inflector when generating tests for `hanami generate slice`, so the module name in the generated test respects the app's custom inflections (such as acronyms). (@timriley in #12)
34
+
35
+ [3.1.0.rc1]: https://github.com/hanami/hanami-minitest/compare/v3.0.0...v3.1.0.rc1
23
36
 
24
37
  ## [3.0.0] - 2026-06-30
25
38
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [actions]: https://github.com/hanami/hanami-minitest/actions
4
4
  [chat]: https://discord.gg/naQApPAsZB
5
- [forum]: https://discourse.hanamirb.org
5
+ [forum]: https://discourse.hanakai.org
6
6
  [rubygem]: https://rubygems.org/gems/hanami-minitest
7
7
 
8
8
  # hanami-minitest [![Gem Version](https://badge.fury.io/rb/hanami-minitest.svg)][rubygem] [![CI Status](https://github.com/hanami/hanami-minitest/workflows/CI/badge.svg)][actions]
@@ -29,8 +29,6 @@ $ bundle exec hanami setup
29
29
 
30
30
  ## Usage
31
31
 
32
- For detailed examples, see [EXAMPLES.md](EXAMPLES.md).
33
-
34
32
  When you run `hanami setup`, this gem will automatically:
35
33
 
36
34
  - Add test dependencies to your `Gemfile`
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.required_ruby_version = ">= 3.3"
32
32
 
33
- spec.add_runtime_dependency "hanami-cli", "~> 3.0.0"
33
+ spec.add_runtime_dependency "hanami-cli", "~> 3.1.0.rc"
34
34
  spec.add_runtime_dependency "minitest", "~> 5.25"
35
35
  spec.add_runtime_dependency "zeitwerk", "~> 2.6"
36
36
  spec.add_development_dependency "bundler"
@@ -7,7 +7,7 @@ module Hanami
7
7
  # @api private
8
8
  module Commands
9
9
  class Install < Hanami::CLI::Command
10
- def call(*, **)
10
+ def call
11
11
  append_gemfile
12
12
  append_gitignore
13
13
  copy_test_helper
@@ -106,17 +106,17 @@ module Hanami
106
106
  end
107
107
 
108
108
  module Generate
109
- class Slice < Hanami::CLI::Command
110
- def call(options = nil, name: nil, **)
109
+ class Slice < Hanami::CLI::Commands::App::Command
110
+ def call(name:)
111
111
  slice = inflector.underscore(Shellwords.shellescape(name))
112
112
 
113
- generator = Generators::Slice.new(fs: fs, inflector: inflector)
113
+ generator = Generators::Slice.new(fs:, inflector:)
114
114
  generator.call(slice)
115
115
  end
116
116
  end
117
117
 
118
118
  class Action < Hanami::CLI::Commands::App::Command
119
- def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
119
+ def call(name:, slice: nil, skip_tests: false)
120
120
  return if skip_tests
121
121
 
122
122
  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
@@ -131,19 +131,19 @@ module Hanami
131
131
  end
132
132
 
133
133
  class Part < Hanami::CLI::Commands::App::Command
134
- def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
134
+ def call(name:, slice: nil, skip_tests: false)
135
135
  return if skip_tests
136
136
 
137
137
  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
138
138
  name = inflector.underscore(Shellwords.shellescape(name))
139
139
 
140
- generator = Generators::Part.new(fs: fs, inflector: inflector)
140
+ generator = Generators::Part.new(fs:, inflector:)
141
141
  generator.call(app.namespace, slice, name)
142
142
  end
143
143
  end
144
144
 
145
145
  class Operation < Hanami::CLI::Commands::App::Command
146
- def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
146
+ def call(name:, slice: nil, skip_tests: false)
147
147
  return if skip_tests
148
148
 
149
149
  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
@@ -158,7 +158,7 @@ module Hanami
158
158
  end
159
159
 
160
160
  class Mailer < Hanami::CLI::Commands::App::Command
161
- def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
161
+ def call(name:, slice: nil, skip_tests: false)
162
162
  return if skip_tests
163
163
 
164
164
  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "test_helper"
4
4
 
5
- class RootTest < Hanami::Minitest::RequestTest
5
+ class RootTest < RequestTest
6
6
  test "not found" do
7
7
  get "/"
8
8
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Hanami::Minitest::FeatureTest
3
+ class FeatureTest < Hanami::Minitest::FeatureTest
4
4
  # Add custom feature test helpers here.
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Hanami::Minitest::RequestTest
3
+ class RequestTest < Hanami::Minitest::RequestTest
4
4
  # Add custom request test helpers here.
5
5
  end
@@ -5,6 +5,6 @@ module Hanami
5
5
  # The current hanami-minitest version.
6
6
  #
7
7
  # @api public
8
- VERSION = "3.0.0"
8
+ VERSION = "3.1.0.rc1"
9
9
  end
10
10
  end
@@ -42,18 +42,26 @@ module Hanami
42
42
 
43
43
  if Hanami.bundled?("dry-operation")
44
44
  Hanami::CLI.after "generate operation", Commands::Generate::Operation
45
+ Hanami::CLI.option "generate operation", :skip_tests,
46
+ required: false, type: :flag, default: false, desc: "Skip test generation"
45
47
  end
46
48
 
47
49
  if Hanami.bundled?("hanami-action")
48
50
  Hanami::CLI.after "generate action", Commands::Generate::Action
51
+ Hanami::CLI.option "generate action", :skip_tests,
52
+ required: false, type: :flag, default: false, desc: "Skip test generation"
49
53
  end
50
54
 
51
55
  if Hanami.bundled?("hanami-view")
52
56
  Hanami::CLI.after "generate part", Commands::Generate::Part
57
+ Hanami::CLI.option "generate part", :skip_tests,
58
+ required: false, type: :flag, default: false, desc: "Skip test generation"
53
59
  end
54
60
 
55
61
  if Hanami.bundled?("hanami-mailer")
56
62
  Hanami::CLI.after "generate mailer", Commands::Generate::Mailer
63
+ Hanami::CLI.option "generate mailer", :skip_tests,
64
+ required: false, type: :flag, default: false, desc: "Skip test generation"
57
65
  end
58
66
  end
59
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 3.0.0
18
+ version: 3.1.0.rc
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 3.0.0
25
+ version: 3.1.0.rc
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: minitest
28
28
  requirement: !ruby/object:Gem::Requirement