hanami-rspec 2.3.0 → 2.3.1

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: c35e14348417f5144f25a0adcad009e2565b4e6ae1389cf99369648f51df3c70
4
- data.tar.gz: 9981e1c6f375aa99b554166e96a4ab499d38b8550d1200369f6ad6119f29514e
3
+ metadata.gz: 1a2185e39d0b525de7f16d338057a0e2f87b1b2537663c63f0d0f2f9ddc09741
4
+ data.tar.gz: 691c5b210355c983af3a879dca1cf69cfbb6197b6c7151a76d37d78b002748c4
5
5
  SHA512:
6
- metadata.gz: 72c72cc355cc6a1116123a9f5639cb6e1004ee0563220bfa4bdb2597f2eb3fd4c8b4c2f33bddfeceacd9e4d1a2aaf18efa2f3146a3e8a6d245a52aba812fc2a5
7
- data.tar.gz: c964883c6fbea6c167addd58df39e2fc5e3f46a6d24261f6227ee4074be1b4ffaa6a2cbd82344755fc0de211e357ea45eba9cb2a593f2d419ce817d759c773c7
6
+ metadata.gz: 79f9422d2a433e90b9b4cf0bc2a8e963c12869004aeac391425c1f23413d5b3c78f04683ba5bd44f10ec74a74c31a9ae99c7fee7f5c96c2e377efbe665b822eb
7
+ data.tar.gz: 146c5ee5983d235ddd02a8263d74c67c13acf8e1f58e491c9c068ee0383f6e56e3e7972de2ba47ada5db3b5bca2f1e8cce00e8d11c4dfbb04b43dfa12a6974ac
@@ -14,6 +14,7 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  ruby:
17
+ - "4.0"
17
18
  - "3.4"
18
19
  - "3.3"
19
20
  - "3.2"
data/CHANGELOG.md CHANGED
@@ -1,34 +1,69 @@
1
- # Hanami::RSpec
1
+ # Changelog
2
2
 
3
- RSpec support for Hanami
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- ## v2.3.0 - 2025-11-12
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
7
- ## v2.3.0.beta2 - 2025-10-17
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+
14
+ ### Deprecated
15
+
16
+ ### Removed
17
+
18
+ ### Fixed
19
+
20
+ ### Security
21
+
22
+ [Unreleased]: https://github.com/hanami/rspec/compare/v2.3.0...HEAD
23
+
24
+ ## [2.3.1] - 2026-01-23
25
+
26
+ ### Fixed
27
+
28
+ - Allow command callbacks to run with both Dry CLI 1.3 and 1.4 (1.4 corrects a longstanding bug regarding argument passing to command callbacks, which we had previously worked around here). (@timriley in #41)
29
+
30
+ ## [2.3.0] - 2025-11-12
31
+
32
+ [2.3.0]: https://github.com/hanami/rspec/compare/v2.3.0.beta2...v2.3.0
33
+
34
+ ## [2.3.0.beta2] - 2025-10-17
8
35
 
9
36
  ### Changed
10
37
 
11
38
  - Drop support for Ruby 3.1
12
39
 
13
- ## v2.3.0.beta1 - 2025-10-03
40
+ [2.3.0.beta2]: https://github.com/hanami/rspec/compare/v2.3.0.beta1...v2.3.0.beta2
41
+
42
+ ## [2.3.0.beta1] - 2025-10-03
14
43
 
15
44
  ### Changed
16
45
 
17
46
  - [Aaron Allen] Change shared context name in generated `spec/support/requests.rb` to avoid a RuboCop RSpec offense (#40)
18
47
 
19
- ## v2.2.1 - 2024-11-12
48
+ [2.3.0.beta1]: https://github.com/hanami/rspec/compare/v2.2.1...v2.3.0.beta1
49
+
50
+ ## [2.2.1] - 2024-11-12
20
51
 
21
52
  ### Changed
22
53
 
23
54
  - [Tim Riley] Modify `Gemfile` via a `before "install"` hook on the `hanami` CLI. This ensures that testing-related gems are installed as part of running `hanami new` (#30)
24
55
 
25
- ## v2.2.0 - 2024-11-05
56
+ [2.2.1]: https://github.com/hanami/rspec/compare/v2.2.0...v2.2.1
57
+
58
+ ## [2.2.0] - 2024-11-05
26
59
 
27
60
  ### Changed
28
61
 
29
62
  - [Paweł Świątkowski, Seb Wilgosz] Only enhance `generate` CLI commands if the relevant gems are bundled (#29)
30
63
 
31
- ## v2.2.0.rc1 - 2024-10-29
64
+ [2.2.0]: https://github.com/hanami/rspec/compare/v2.2.0.rc1...v2.2.0
65
+
66
+ ## [2.2.0.rc1] - 2024-10-29
32
67
 
33
68
  ### Added
34
69
 
@@ -38,13 +73,9 @@ RSpec support for Hanami
38
73
 
39
74
  - [Seb Wilgosz] Only enhance `generate` CLI commands if the relevant gems are bundled (#26)
40
75
 
41
- ## v2.2.0.beta1 - 2024-07-16
76
+ [2.2.0.rc1]: https://github.com/hanami/rspec/compare/v2.2.0.beta1...v2.2.0.rc1
42
77
 
43
- ### Changed
44
-
45
- - [Sean Collins] In generated `spec_helper.rb`, require all files under `spec/support/` in a loop, rather than via manual requires (#24)
46
-
47
- ## v2.2.0.beta1 - 2024-07-16
78
+ ## [2.2.0.beta1] - 2024-07-16
48
79
 
49
80
  ### Added
50
81
 
@@ -53,23 +84,32 @@ RSpec support for Hanami
53
84
  ### Changed
54
85
 
55
86
  - Drop support for Ruby 3.0
87
+ - [Sean Collins] In generated `spec_helper.rb`, require all files under `spec/support/` in a loop, rather than via manual requires (#24)
56
88
 
57
- ## v2.1.0 - 2024-02-27
89
+ [2.2.0.beta1]: https://github.com/hanami/rspec/compare/v2.1.0...v2.2.0.beta1
58
90
 
59
- ## v2.1.0.rc3 - 2024-02-16
91
+ ## [2.1.0] - 2024-02-27
60
92
 
61
- ## v2.1.0.rc2 - 2023-11-08
93
+ [2.1.0]: https://github.com/hanami/rspec/compare/v2.1.0.rc3...v2.1.0
94
+
95
+ ## [2.1.0.rc3] - 2024-02-16
96
+
97
+ [2.1.0.rc3]: https://github.com/hanami/rspec/compare/v2.1.0.rc2...v2.1.0.rc3
98
+
99
+ ## [2.1.0.rc2] - 2023-11-08
62
100
 
63
101
  ### Added
64
102
 
65
- - [Tim Riley] Skip generating tests for `hanami generate` when `--skip-tests` CLI option is given.
66
- - [Tim Riley] Install Capybara and generate `spec/support/capybara.rb` in `hanami install` hook.
103
+ - [Tim Riley] Skip generating tests for `hanami generate` when `--skip-tests` CLI option is given
104
+ - [Tim Riley] Install Capybara and generate `spec/support/capybara.rb` in `hanami install` hook
67
105
 
68
106
  ### Changed
69
107
 
70
- - [Tim Riley] Add explanatory code comments to `spec/support/rspec.rb` generated in `hanami install` hook.
108
+ - [Tim Riley] Add explanatory code comments to `spec/support/rspec.rb` generated in `hanami install` hook
109
+
110
+ [2.1.0.rc2]: https://github.com/hanami/rspec/compare/v2.1.0.rc1...v2.1.0.rc2
71
111
 
72
- ## v2.1.0.rc1 - 2023-11-01
112
+ ## [2.1.0.rc1] - 2023-11-01
73
113
 
74
114
  ### Added
75
115
 
@@ -79,48 +119,66 @@ RSpec support for Hanami
79
119
 
80
120
  - [Luca Guidi] Default request spec to expect 404, now that `hanami new` doesn't generate a default root route anymore
81
121
 
82
- ## v2.1.0.beta1 - 2023-06-29
122
+ [2.1.0.rc1]: https://github.com/hanami/rspec/compare/v2.1.0.beta1...v2.1.0.rc1
83
123
 
84
- ## v2.0.1 - 2022-12-25
124
+ ## [2.1.0.beta1] - 2023-06-29
125
+
126
+ [2.1.0.beta1]: https://github.com/hanami/rspec/compare/v2.0.1...v2.1.0.beta1
127
+
128
+ ## [2.0.1] - 2022-12-25
85
129
 
86
130
  ### Added
87
131
 
88
132
  - [Luca Guidi] Official support for Ruby 3.2
89
133
 
90
- ## v2.0.0 - 2022-11-22
134
+ [2.0.1]: https://github.com/hanami/rspec/compare/v2.0.0...v2.0.1
135
+
136
+ ## [2.0.0] - 2022-11-22
91
137
 
92
138
  ### Added
93
139
 
94
140
  - [Tim Riley] Use Zeitwerk to autoload the gem
95
141
  - [Luca Guidi] Support RSpec 3.12
96
142
 
97
- ## v2.0.0.rc1 - 2022-11-08
143
+ [2.0.0]: https://github.com/hanami/rspec/compare/v2.0.0.rc1...v2.0.0
144
+
145
+ ## [2.0.0.rc1] - 2022-11-08
98
146
 
99
147
  ### Changed
100
148
 
101
149
  - [Luca Guidi] Follow `hanami` versioning
102
150
 
103
- ## v3.11.0.beta4 - 2022-10-24
151
+ [2.0.0.rc1]: https://github.com/hanami/rspec/compare/v3.11.0.beta4...v2.0.0.rc1
152
+
153
+ ## [3.11.0.beta4] - 2022-10-24
104
154
 
105
155
  ### Changed
106
156
 
107
157
  - [Luca Guidi] Generate slice specs under `spec/slices/[slice_name]/` (#9)
108
158
 
109
- ## v3.11.0.beta3 - 2022-09-21
159
+ [3.11.0.beta4]: https://github.com/hanami/rspec/compare/v3.11.0.beta3...v3.11.0.beta4
160
+
161
+ ## [3.11.0.beta3] - 2022-09-21
110
162
 
111
163
  ### Added
112
164
 
113
165
  - [Luca Guidi] Hook into `hanami new` and `hanami generate` to respect name pluralization
114
166
  - [Luca Guidi] Hook into `hanami generate action` to generate action specs
115
167
 
116
- ## v3.11.0.beta2 - 2022-08-16
168
+ [3.11.0.beta3]: https://github.com/hanami/rspec/compare/v3.11.0.beta2...v3.11.0.beta3
169
+
170
+ ## [3.11.0.beta2] - 2022-08-16
117
171
 
118
172
  ### Added
119
173
 
120
- - [Luca Guidi] Hook into `hanami generate slice` to generate a slice directory in spec/ along with a placeholder base action spec [#5]
174
+ - [Luca Guidi] Hook into `hanami generate slice` to generate a slice directory in spec/ along with a placeholder base action spec (#5)
121
175
 
122
- ## v3.11.0.beta1 - 2022-07-20
176
+ [3.11.0.beta2]: https://github.com/hanami/rspec/compare/v3.11.0.beta1...v3.11.0.beta2
177
+
178
+ ## [3.11.0.beta1] - 2022-07-20
123
179
 
124
180
  ### Added
125
181
 
126
182
  - [Luca Guidi] Hook into `hanami install` to setup RSpec + Rack::Test
183
+
184
+ [3.11.0.beta1]: https://github.com/hanami/rspec/releases/tag/v3.11.0.beta1
@@ -114,9 +114,20 @@ module Hanami
114
114
  # @since 2.0.0
115
115
  # @api private
116
116
  class Slice < Hanami::CLI::Command
117
- # FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
118
- def call(options, **)
119
- slice = inflector.underscore(Shellwords.shellescape(options[:name]))
117
+ # @since 2.0.0
118
+ # @api private
119
+ def call(options = nil, name: nil, **)
120
+ # Support multiple calling conventions for dry-cli cross-version compatibility:
121
+ #
122
+ # - dry-cli 1.3 calls with positional hash: call({name: "foo"})
123
+ # - dry-cli 1.4+: calls with keyword arguments: call(name: "foo")
124
+ #
125
+ # TODO: Remove this with Hanami 2.4 (which will require dry-cli 1.4+).
126
+ if options.is_a?(Hash)
127
+ name = options[:name]
128
+ end
129
+
130
+ slice = inflector.underscore(Shellwords.shellescape(name))
120
131
 
121
132
  generator = Generators::Slice.new(fs: fs, inflector: inflector)
122
133
  generator.call(slice)
@@ -128,13 +139,23 @@ module Hanami
128
139
  class Action < Hanami::CLI::Commands::App::Command
129
140
  # @since 2.0.0
130
141
  # @api private
131
- def call(options, **)
132
- # FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
133
-
134
- return if options[:skip_tests]
135
-
136
- slice = inflector.underscore(Shellwords.shellescape(options[:slice])) if options[:slice]
137
- key = inflector.underscore(Shellwords.shellescape(options[:name]))
142
+ def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
143
+ # Support multiple calling conventions for dry-cli cross-version compatibility:
144
+ #
145
+ # - dry-cli 1.3 calls with positional hash: call({name: "foo"})
146
+ # - dry-cli 1.4+: calls with keyword arguments: call(name: "foo")
147
+ #
148
+ # TODO: Remove this with Hanami 2.4 (which will require dry-cli 1.4+).
149
+ if options.is_a?(Hash)
150
+ name = options[:name]
151
+ slice = options[:slice]
152
+ skip_tests = options[:skip_tests] || false
153
+ end
154
+
155
+ return if skip_tests
156
+
157
+ slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
158
+ key = inflector.underscore(Shellwords.shellescape(name))
138
159
 
139
160
  namespace = slice ? inflector.camelize(slice) : app.namespace
140
161
  base_path = slice ? "spec/slices/#{slice}" : "spec"
@@ -149,13 +170,23 @@ module Hanami
149
170
  class Part < Hanami::CLI::Commands::App::Command
150
171
  # @since 2.1.0
151
172
  # @api private
152
- def call(options, **)
153
- # FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
154
-
155
- return if options[:skip_tests]
156
-
157
- slice = inflector.underscore(Shellwords.shellescape(options[:slice])) if options[:slice]
158
- name = inflector.underscore(Shellwords.shellescape(options[:name]))
173
+ def call(options = nil, name: nil, slice: nil, skip_tests: false, **)
174
+ # Support multiple calling conventions for dry-cli cross-version compatibility:
175
+ #
176
+ # - dry-cli 1.3 calls with positional hash: call({name: "foo"})
177
+ # - dry-cli 1.4+: calls with keyword arguments: call(name: "foo")
178
+ #
179
+ # TODO: Remove this with Hanami 2.4 (which will require dry-cli 1.4+).
180
+ if options.is_a?(Hash)
181
+ name = options[:name]
182
+ slice = options[:slice]
183
+ skip_tests = options[:skip_tests] || false
184
+ end
185
+
186
+ return if skip_tests
187
+
188
+ slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
189
+ name = inflector.underscore(Shellwords.shellescape(name))
159
190
 
160
191
  generator = Generators::Part.new(fs: fs, inflector: inflector)
161
192
  generator.call(app.namespace, slice, name)
@@ -6,6 +6,6 @@ module Hanami
6
6
  #
7
7
  # @since 2.0.0
8
8
  # @api public
9
- VERSION = "2.3.0"
9
+ VERSION = "2.3.1"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team