hanami-rspec 2.3.0.beta2 → 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: 0af8c0843959599de80bce86e2ab4f2352f331ba3e0c26cb809885d1578b13fb
4
- data.tar.gz: 537e0134e03a4728452948791eb6c71e24db5354d5c28061ce31d2365e2ce479
3
+ metadata.gz: 1a2185e39d0b525de7f16d338057a0e2f87b1b2537663c63f0d0f2f9ddc09741
4
+ data.tar.gz: 691c5b210355c983af3a879dca1cf69cfbb6197b6c7151a76d37d78b002748c4
5
5
  SHA512:
6
- metadata.gz: 3cad888bebd03004f2b1d3b6f792e346072f7c53584d7369c9dcaff91fbba5b7092459590285caa16f52838a3e300ed7ffc11daf6dc596d750b93f3a181437bb
7
- data.tar.gz: d1987acefecac5d67439d5ebf91e1f80a955a683382129d40ded017eec29a498b9a817c49fb29c5bceba13c76c2fdf8a3e978327d34cac4664759fb92d9e8b92
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,32 +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.beta2 - 2025-10-17
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).
7
+
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
6
35
 
7
36
  ### Changed
8
37
 
9
38
  - Drop support for Ruby 3.1
10
39
 
11
- ## 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
12
43
 
13
44
  ### Changed
14
45
 
15
46
  - [Aaron Allen] Change shared context name in generated `spec/support/requests.rb` to avoid a RuboCop RSpec offense (#40)
16
47
 
17
- ## 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
18
51
 
19
52
  ### Changed
20
53
 
21
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)
22
55
 
23
- ## 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
24
59
 
25
60
  ### Changed
26
61
 
27
62
  - [Paweł Świątkowski, Seb Wilgosz] Only enhance `generate` CLI commands if the relevant gems are bundled (#29)
28
63
 
29
- ## 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
30
67
 
31
68
  ### Added
32
69
 
@@ -36,13 +73,9 @@ RSpec support for Hanami
36
73
 
37
74
  - [Seb Wilgosz] Only enhance `generate` CLI commands if the relevant gems are bundled (#26)
38
75
 
39
- ## v2.2.0.beta1 - 2024-07-16
40
-
41
- ### Changed
42
-
43
- - [Sean Collins] In generated `spec_helper.rb`, require all files under `spec/support/` in a loop, rather than via manual requires (#24)
76
+ [2.2.0.rc1]: https://github.com/hanami/rspec/compare/v2.2.0.beta1...v2.2.0.rc1
44
77
 
45
- ## v2.2.0.beta1 - 2024-07-16
78
+ ## [2.2.0.beta1] - 2024-07-16
46
79
 
47
80
  ### Added
48
81
 
@@ -51,23 +84,32 @@ RSpec support for Hanami
51
84
  ### Changed
52
85
 
53
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)
88
+
89
+ [2.2.0.beta1]: https://github.com/hanami/rspec/compare/v2.1.0...v2.2.0.beta1
90
+
91
+ ## [2.1.0] - 2024-02-27
54
92
 
55
- ## v2.1.0 - 2024-02-27
93
+ [2.1.0]: https://github.com/hanami/rspec/compare/v2.1.0.rc3...v2.1.0
56
94
 
57
- ## v2.1.0.rc3 - 2024-02-16
95
+ ## [2.1.0.rc3] - 2024-02-16
58
96
 
59
- ## v2.1.0.rc2 - 2023-11-08
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
60
100
 
61
101
  ### Added
62
102
 
63
- - [Tim Riley] Skip generating tests for `hanami generate` when `--skip-tests` CLI option is given.
64
- - [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
65
105
 
66
106
  ### Changed
67
107
 
68
- - [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
69
111
 
70
- ## v2.1.0.rc1 - 2023-11-01
112
+ ## [2.1.0.rc1] - 2023-11-01
71
113
 
72
114
  ### Added
73
115
 
@@ -77,48 +119,66 @@ RSpec support for Hanami
77
119
 
78
120
  - [Luca Guidi] Default request spec to expect 404, now that `hanami new` doesn't generate a default root route anymore
79
121
 
80
- ## 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
81
123
 
82
- ## 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
83
129
 
84
130
  ### Added
85
131
 
86
132
  - [Luca Guidi] Official support for Ruby 3.2
87
133
 
88
- ## 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
89
137
 
90
138
  ### Added
91
139
 
92
140
  - [Tim Riley] Use Zeitwerk to autoload the gem
93
141
  - [Luca Guidi] Support RSpec 3.12
94
142
 
95
- ## 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
96
146
 
97
147
  ### Changed
98
148
 
99
149
  - [Luca Guidi] Follow `hanami` versioning
100
150
 
101
- ## 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
102
154
 
103
155
  ### Changed
104
156
 
105
157
  - [Luca Guidi] Generate slice specs under `spec/slices/[slice_name]/` (#9)
106
158
 
107
- ## 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
108
162
 
109
163
  ### Added
110
164
 
111
165
  - [Luca Guidi] Hook into `hanami new` and `hanami generate` to respect name pluralization
112
166
  - [Luca Guidi] Hook into `hanami generate action` to generate action specs
113
167
 
114
- ## 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
115
171
 
116
172
  ### Added
117
173
 
118
- - [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)
119
175
 
120
- ## 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
121
179
 
122
180
  ### Added
123
181
 
124
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
data/README.md CHANGED
@@ -6,7 +6,6 @@ RSpec and testing support for [Hanami applications](https://github.com/hanami/ha
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/hanami-rspec.svg)](https://badge.fury.io/rb/hanami-rspec)
8
8
  [![CI](https://github.com/hanami/rspec/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hanami/rspec/actions?query=workflow%3Aci+branch%3Amain)
9
- [![Depfu](https://badges.depfu.com/badges/a8545fb67cf32a2c75b6227bc0821027/overview.svg)](https://depfu.com/github/hanami/rspec?project=Bundler)
10
9
 
11
10
  ## Contact
12
11
 
@@ -17,8 +16,6 @@ RSpec and testing support for [Hanami applications](https://github.com/hanami/ha
17
16
 
18
17
  ## Installation
19
18
 
20
- **Hanami::RSpec** supports Ruby (MRI) 3.1+
21
-
22
19
  Add this line to your application's Gemfile:
23
20
 
24
21
  ```ruby
data/hanami-rspec.gemspec CHANGED
@@ -5,8 +5,8 @@ require_relative "lib/hanami/rspec/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hanami-rspec"
7
7
  spec.version = Hanami::RSpec::VERSION
8
- spec.authors = ["Luca Guidi"]
9
- spec.email = ["me@lucaguidi.com"]
8
+ spec.authors = ["Hanakai team"]
9
+ spec.email = ["info@hanakai.org"]
10
10
 
11
11
  spec.summary = "Hanami RSpec"
12
12
  spec.description = "Hanami RSpec generators and Rake tasks"
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency "hanami-cli", "~> 2.3.0.beta2"
32
+ spec.add_dependency "hanami-cli", "~> 2.3.0"
33
33
  spec.add_dependency "rspec", "~> 3.12"
34
34
  spec.add_dependency "rake", "~> 13.0"
35
35
  spec.add_dependency "zeitwerk", "~> 2.6"
@@ -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.beta2"
9
+ VERSION = "2.3.1"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.beta2
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
- - Luca Guidi
7
+ - Hanakai team
8
8
  bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 2.3.0.beta2
18
+ version: 2.3.0
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: 2.3.0.beta2
25
+ version: 2.3.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  version: '1.11'
82
82
  description: Hanami RSpec generators and Rake tasks
83
83
  email:
84
- - me@lucaguidi.com
84
+ - info@hanakai.org
85
85
  executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files: []