hanami-rspec 3.0.0 → 3.11.0.beta3

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.

Potentially problematic release.


This version of hanami-rspec might be problematic. Click here for more details.

Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +50 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +26 -0
  6. data/CHANGELOG.md +7 -208
  7. data/CODE_OF_CONDUCT.md +84 -0
  8. data/Gemfile +13 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +32 -17
  11. data/Rakefile +12 -0
  12. data/bin/console +15 -0
  13. data/bin/setup +8 -0
  14. data/hanami-rspec.gemspec +26 -26
  15. data/lib/hanami/rspec/commands.rb +25 -109
  16. data/lib/hanami/rspec/error.rb +8 -0
  17. data/lib/hanami/rspec/generators/action/action_slice_spec.erb +10 -0
  18. data/lib/hanami/rspec/generators/action/action_spec.erb +10 -0
  19. data/lib/hanami/rspec/generators/action.rb +29 -36
  20. data/lib/hanami/rspec/generators/gemfile +0 -2
  21. data/lib/hanami/rspec/generators/helper.rb +2 -1
  22. data/lib/hanami/rspec/generators/request.rb +4 -4
  23. data/lib/hanami/rspec/generators/slice.rb +13 -23
  24. data/lib/hanami/rspec/generators/support_requests.rb +2 -3
  25. data/lib/hanami/rspec/generators/support_rspec.rb +2 -36
  26. data/lib/hanami/rspec/generators.rb +10 -0
  27. data/lib/hanami/rspec/rake_tasks.rb +2 -0
  28. data/lib/hanami/rspec/version.rb +1 -4
  29. data/lib/hanami/rspec.rb +2 -47
  30. data/lib/hanami-rspec.rb +1 -1
  31. metadata +41 -41
  32. data/LICENSE +0 -20
  33. data/lib/hanami/rspec/generators/gemfile_db +0 -9
  34. data/lib/hanami/rspec/generators/gitignore +0 -1
  35. data/lib/hanami/rspec/generators/mailer.rb +0 -60
  36. data/lib/hanami/rspec/generators/operation.rb +0 -59
  37. data/lib/hanami/rspec/generators/part/part_base_spec.erb +0 -10
  38. data/lib/hanami/rspec/generators/part/part_slice_base_spec.erb +0 -10
  39. data/lib/hanami/rspec/generators/part/part_slice_spec.erb +0 -10
  40. data/lib/hanami/rspec/generators/part/part_spec.erb +0 -10
  41. data/lib/hanami/rspec/generators/part.rb +0 -114
  42. data/lib/hanami/rspec/generators/support_db.rb +0 -10
  43. data/lib/hanami/rspec/generators/support_db_cleaning.rb +0 -40
  44. data/lib/hanami/rspec/generators/support_features.rb +0 -5
  45. data/lib/hanami/rspec/generators/support_mailers.rb +0 -20
  46. data/lib/hanami/rspec/generators/support_operations.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4baaba2d178ec3923d5fb41010932f163d2d49d04cefb392dc7f42ca1b8374b
4
- data.tar.gz: a29d6961031ce60fe544df4b2f60f0e45ee2e9518b3a90650bf89bde2bd3aed2
3
+ metadata.gz: a3c622f62aeded6a152396460f0bb462d1abc6e1c46e8f009ff7c5defb80f6d0
4
+ data.tar.gz: b473be9664791e51a31c58604f4040df018c82dec2bb4eb1abc9a0da0284629f
5
5
  SHA512:
6
- metadata.gz: 843469322480c2bf22c7605ece0401e44538858b402dd8c7320ab837b15b892d9956c3b6b112476d9485a397282ab566b10c75aff044ea81528dd0a171d403a1
7
- data.tar.gz: e686721d90b7d2583323e10273e119962246b91cbdf612420ea741fe75238e565c2126d65bac7a9ae9cada27ec000e8cc1e6a10b78463797ee320a0a5ff60cd2
6
+ metadata.gz: ac3a26f68ab3ecff9b292ff9a94159547792b5f2c035c9dfd1d92ed30504f39c49f980da62754e6a21d43d9dead44c56b652ad746bb19497d06a42551c6e4cca
7
+ data.tar.gz: f947e767c88960d73e51761b4367f4028d74036d62176c933f160f73274a588ef64cd3b14f44a3ec24f9fe32f214e2acd953924b9ca5a5a976d7e75b7494a295
@@ -0,0 +1,50 @@
1
+ name: ci
2
+
3
+ 'on':
4
+ push:
5
+ paths:
6
+ - '.github/workflows/ci.yml'
7
+ - 'lib/**'
8
+ - '*.gemspec'
9
+ - 'spec/**'
10
+ - 'Rakefile'
11
+ - 'Gemfile'
12
+ - '.rubocop.yml'
13
+ pull_request:
14
+ branches:
15
+ - main
16
+ schedule:
17
+ - cron: '30 4 * * *'
18
+ create:
19
+
20
+ jobs:
21
+ tests:
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ ruby:
27
+ - '3.1'
28
+ - '3.0'
29
+ steps:
30
+ - uses: ravsamhq/notify-slack-action@v1
31
+ if: always()
32
+ with:
33
+ status: ${{ job.status }}
34
+ notify_when: 'failure'
35
+ env:
36
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
37
+ - uses: actions/checkout@v1
38
+ - name: Install package dependencies
39
+ run: '[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS'
40
+ - name: Set up Ruby
41
+ uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: ${{matrix.ruby}}
44
+ - name: Install latest bundler
45
+ run: |
46
+ gem install bundler --no-document
47
+ - name: Bundle install
48
+ run: bundle install --jobs 4 --retry 3
49
+ - name: Run all tests
50
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .rubocop-*
10
+ Gemfile.lock
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ # Please keep AllCops, Bundler, Style, Metrics groups and then order cops
2
+ # alphabetically
3
+ inherit_from:
4
+ - https://raw.githubusercontent.com/hanami/devtools/main/.rubocop.yml
5
+ Layout/LineLength:
6
+ Exclude:
7
+ - Gemfile
8
+ Naming/MethodParameterName:
9
+ AllowedNames:
10
+ - fs
11
+ Naming/HeredocDelimiterNaming:
12
+ Enabled: false
13
+ Style/AccessorGrouping:
14
+ Enabled: false
15
+ Style/BlockDelimiters:
16
+ Enabled: false
17
+ Style/CommentedKeyword:
18
+ Enabled: false
19
+ Style/LambdaCall:
20
+ Enabled: false
21
+ Style/TrailingCommaInArguments:
22
+ Enabled: false
23
+ Style/TrailingCommaInArrayLiteral:
24
+ Enabled: false
25
+ Style/TrailingCommaInHashLiteral:
26
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,219 +1,18 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
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/v3.0.0.rc1...HEAD
23
-
24
- ## [v3.0.0] - 2026-06-30
25
-
26
- ### Added
27
-
28
- - Activate Dry Monads' RSpec extension in `spec/support/operations.rb`. (@timriley in #48)
29
- - Generate a starter spec when running `hanami generate operation`. (@timriley in #48)
30
- - Generate `spec/support/mailers.rb` to reset recorded mail deliveries between examples tagged `:mailers`. Use this tag for the generated mailer tests. (@timriley in #49)
31
- - Generate a starter spec when running `hanami generate mailer`. (@timriley in #48)
32
-
33
- ### Changed
34
-
35
- - Use `prepend_before` for the generated DatabaseCleaner `:db` hook, so it runs before any other `before` hooks that might touch the database. This prevents factory calls in spec-level `before` blocks from running before the test transaction starts and leaking records across tests. (@timriley in #47)
36
- - Check for presence of hanami-action gem rather than hanami-controller (now retired). (@cllns in #44)
37
- - Require Ruby 3.3 or newer.
38
-
39
- [v3.0.0]: https://github.com/hanami/rspec/compare/v2.3.1...v3.0.0
40
-
41
- ## [v3.0.0.rc1] - 2026-06-16
1
+ ## v3.11.0.beta3 - 2022-09-21
42
2
 
43
3
  ### Added
44
4
 
45
- - Activate Dry Monads' RSpec extension in `spec/support/operations.rb`. (@timriley)
46
- - Generate a starter spec when running `hanami generate operation`. (@timriley)
47
- - Generate a starter spec when running `hanami generate mailer`. (@timriley)
48
-
49
- ### Changed
50
-
51
- - Use `prepend_before` for the generated DatabaseCleaner `:db` hook, so it runs before any other `before` hooks that might touch the database. This prevents factory calls in spec-level `before` blocks from running before the test transaction starts and leaking records across tests. (@timriley in #47)
52
- - Check for presence of hanami-action gem rather than hanami-controller (now retired). (@cllns in #44)
53
- - Require Ruby 3.3 or newer.
54
-
55
- [v3.0.0.rc1]: https://github.com/hanami/rspec/compare/v2.3.1...v3.0.0.rc1
56
-
57
- ## [2.3.1] - 2026-01-23
58
-
59
- ### Fixed
60
-
61
- - 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). (Tim Riley in #41)
62
-
63
- [2.3.1]: https://github.com/hanami/rspec/compare/v2.3.0...v2.3.1
5
+ - [Luca Guidi] Hook into `hanami new` and `hanami generate` to respect name pluralization
6
+ - [Luca Guidi] Hook into `hanami generate action` to generate action specs
64
7
 
65
- ## [2.3.0] - 2025-11-12
66
-
67
- [2.3.0]: https://github.com/hanami/rspec/compare/v2.3.0.beta2...v2.3.0
68
-
69
- ## [2.3.0.beta2] - 2025-10-17
70
-
71
- ### Changed
72
-
73
- - Drop support for Ruby 3.1.
74
-
75
- [2.3.0.beta2]: https://github.com/hanami/rspec/compare/v2.3.0.beta1...v2.3.0.beta2
76
-
77
- ## [2.3.0.beta1] - 2025-10-03
78
-
79
- ### Changed
80
-
81
- - Change shared context name in generated `spec/support/requests.rb` to avoid a RuboCop RSpec offense. (Aaron Allen in #40)
82
-
83
- [2.3.0.beta1]: https://github.com/hanami/rspec/compare/v2.2.1...v2.3.0.beta1
84
-
85
- ## [2.2.1] - 2024-11-12
86
-
87
- ### Changed
88
-
89
- - 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`. (Tim Riley in #30)
90
-
91
- [2.2.1]: https://github.com/hanami/rspec/compare/v2.2.0...v2.2.1
92
-
93
- ## [2.2.0] - 2024-11-05
94
-
95
- ### Changed
96
-
97
- - Only enhance `generate` CLI commands if the relevant gems are bundled. (Paweł Świątkowski, Seb Wilgosz in #29)
98
-
99
- [2.2.0]: https://github.com/hanami/rspec/compare/v2.2.0.rc1...v2.2.0
100
-
101
- ## [2.2.0.rc1] - 2024-10-29
8
+ ## v3.11.0.beta2 - 2022-08-16
102
9
 
103
10
  ### Added
104
11
 
105
- - As part of `hanami install`, add `database_cleaner-sequel` to the `Gemfile` and generate DatabaseCleaner configuration in `spec/support/db.rb` and `spec/support/db/cleaning.rb`. (Tim Riley in #28)
106
-
107
- ### Changed
108
-
109
- - Only enhance `generate` CLI commands if the relevant gems are bundled. (Seb Wilgosz in #26)
12
+ - [Luca Guidi] Hook into `hanami generate slice` to generate a slice directory in spec/ along with a placeholder base action spec [#5]
110
13
 
111
- [2.2.0.rc1]: https://github.com/hanami/rspec/compare/v2.2.0.beta1...v2.2.0.rc1
112
-
113
- ## [2.2.0.beta1] - 2024-07-16
14
+ ## v3.11.0.beta1 - 2022-07-20
114
15
 
115
16
  ### Added
116
17
 
117
- - Include `Dry::Monads[:result]` in tests via `support/operations.rb`. (Sean Collins)
118
-
119
- ### Changed
120
-
121
- - Drop support for Ruby 3.0
122
- - In generated `spec_helper.rb`, require all files under `spec/support/` in a loop, rather than via manual requires. (Sean Collins in #24)
123
-
124
- [2.2.0.beta1]: https://github.com/hanami/rspec/compare/v2.1.0...v2.2.0.beta1
125
-
126
- ## [2.1.0] - 2024-02-27
127
-
128
- [2.1.0]: https://github.com/hanami/rspec/compare/v2.1.0.rc3...v2.1.0
129
-
130
- ## [2.1.0.rc3] - 2024-02-16
131
-
132
- [2.1.0.rc3]: https://github.com/hanami/rspec/compare/v2.1.0.rc2...v2.1.0.rc3
133
-
134
- ## [2.1.0.rc2] - 2023-11-08
135
-
136
- ### Added
137
-
138
- - Skip generating tests for `hanami generate` when `--skip-tests` CLI option is given. (Tim Riley)
139
- - Install Capybara and generate `spec/support/capybara.rb` in `hanami install` hook. (Tim Riley)
140
-
141
- ### Changed
142
-
143
- - Add explanatory code comments to `spec/support/rspec.rb` generated in `hanami install` hook. (Tim Riley)
144
-
145
- [2.1.0.rc2]: https://github.com/hanami/rspec/compare/v2.1.0.rc1...v2.1.0.rc2
146
-
147
- ## [2.1.0.rc1] - 2023-11-01
148
-
149
- ### Added
150
-
151
- - Generate spec for `hanami generate part` command. (Luca Guidi)
152
-
153
- ### Changed
154
-
155
- - Default request spec to expect 404, now that `hanami new` doesn't generate a default root route anymore. (Luca Guidi)
156
-
157
- [2.1.0.rc1]: https://github.com/hanami/rspec/compare/v2.1.0.beta1...v2.1.0.rc1
158
-
159
- ## [2.1.0.beta1] - 2023-06-29
160
-
161
- [2.1.0.beta1]: https://github.com/hanami/rspec/compare/v2.0.1...v2.1.0.beta1
162
-
163
- ## [2.0.1] - 2022-12-25
164
-
165
- ### Added
166
-
167
- - Official support for Ruby 3.2. (Luca Guidi)
168
-
169
- [2.0.1]: https://github.com/hanami/rspec/compare/v2.0.0...v2.0.1
170
-
171
- ## [2.0.0] - 2022-11-22
172
-
173
- ### Added
174
-
175
- - Use Zeitwerk to autoload the gem. (Tim Riley)
176
- - Support RSpec 3.12. (Luca Guidi)
177
-
178
- [2.0.0]: https://github.com/hanami/rspec/compare/v2.0.0.rc1...v2.0.0
179
-
180
- ## [2.0.0.rc1] - 2022-11-08
181
-
182
- ### Changed
183
-
184
- - Follow `hanami` versioning. (Luca Guidi)
185
-
186
- [2.0.0.rc1]: https://github.com/hanami/rspec/compare/v3.11.0.beta4...v2.0.0.rc1
187
-
188
- ## [3.11.0.beta4] - 2022-10-24
189
-
190
- ### Changed
191
-
192
- - Generate slice specs under `spec/slices/[slice_name]/`. (Luca Guidi in #9)
193
-
194
- [3.11.0.beta4]: https://github.com/hanami/rspec/compare/v3.11.0.beta3...v3.11.0.beta4
195
-
196
- ## [3.11.0.beta3] - 2022-09-21
197
-
198
- ### Added
199
-
200
- - Hook into `hanami new` and `hanami generate` to respect name pluralization. (Luca Guidi)
201
- - Hook into `hanami generate action` to generate action specs. (Luca Guidi)
202
-
203
- [3.11.0.beta3]: https://github.com/hanami/rspec/compare/v3.11.0.beta2...v3.11.0.beta3
204
-
205
- ## [3.11.0.beta2] - 2022-08-16
206
-
207
- ### Added
208
-
209
- - Hook into `hanami generate slice` to generate a slice directory in spec/ along with a placeholder base action spec. (Luca Guidi in #5)
210
-
211
- [3.11.0.beta2]: https://github.com/hanami/rspec/compare/v3.11.0.beta1...v3.11.0.beta2
212
-
213
- ## [3.11.0.beta1] - 2022-07-20
214
-
215
- ### Added
216
-
217
- - Hook into `hanami install` to setup RSpec + Rack::Test. (Luca Guidi)
218
-
219
- [3.11.0.beta1]: https://github.com/hanami/rspec/releases/tag/v3.11.0.beta1
18
+ - [Luca Guidi] Hook into `hanami install` to setup RSpec + Rack::Test
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at me@lucaguidi.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec
5
+
6
+ unless ENV["CI"]
7
+ gem "byebug", require: false, platforms: :mri
8
+ gem "yard", require: false
9
+ end
10
+
11
+ gem "dry-files", require: false, git: "https://github.com/dry-rb/dry-files.git", branch: "main"
12
+ gem "hanami-cli", require: false, git: "https://github.com/hanami/cli.git", branch: "main"
13
+ gem "hanami", require: false, git: "https://github.com/hanami/hanami.git", branch: "main"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Luca Guidi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,14 +1,28 @@
1
- <!--- This file is synced from hanakai-rb/repo-sync -->
1
+ # Hanami::RSpec
2
2
 
3
- [actions]: https://github.com/hanami/hanami-rspec/actions
4
- [chat]: https://discord.gg/naQApPAsZB
5
- [forum]: https://discourse.hanamirb.org
6
- [rubygem]: https://rubygems.org/gems/hanami-rspec
3
+ RSpec and testing support for [full-stack Hanami applications](`https://github.com/hanami/hanami`).
7
4
 
8
- # Hanami RSpec [![Gem Version](https://badge.fury.io/rb/hanami-rspec.svg)][rubygem] [![CI Status](https://github.com/hanami/hanami-rspec/workflows/CI/badge.svg)][actions]
5
+ ## Status
9
6
 
10
- [![Forum](https://img.shields.io/badge/Forum-dc360f?logo=discourse&logoColor=white)][forum]
11
- [![Chat](https://img.shields.io/badge/Chat-717cf8?logo=discord&logoColor=white)][chat]
7
+ [![Gem Version](https://badge.fury.io/rb/hanami-rspec.svg)](https://badge.fury.io/rb/hanami-rspec)
8
+ [![CI](https://github.com/hanami/rspec/workflows/ci/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
+
11
+ ## Version
12
+
13
+ Versioning of this gem follows RSpec.
14
+
15
+ ## Contact
16
+
17
+ - Home page: http://hanamirb.org
18
+ - Mailing List: http://hanamirb.org/mailing-list
19
+ - Bugs/Issues: https://github.com/hanami/rspec/issues
20
+ - Support: http://stackoverflow.com/questions/tagged/hanami
21
+ - Chat: http://chat.hanamirb.org
22
+
23
+ ## Rubies
24
+
25
+ **Hanami::RSpec** supports Ruby (MRI) 3.0+
12
26
 
13
27
  ## Installation
14
28
 
@@ -22,10 +36,10 @@ end
22
36
 
23
37
  And then execute:
24
38
 
25
- ```
26
- $ bundle install
27
- $ bundle exec hanami setup
28
- ```
39
+ $ bundle install
40
+ $ bundle exec hanami setup
41
+
42
+ ## Usage
29
43
 
30
44
  ## Development
31
45
 
@@ -37,13 +51,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
37
51
 
38
52
  Bug reports and pull requests are welcome on GitHub at https://github.com/hanami/rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/hanami/rspec/blob/main/CODE_OF_CONDUCT.md).
39
53
 
40
- ## Links
54
+ ## License
41
55
 
42
- - [User documentation](https://hanamirb.org)
43
- - [API documentation](http://rubydoc.info/gems/hanami-rspec)
56
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
44
57
 
58
+ ## Code of Conduct
45
59
 
46
- ## License
60
+ Everyone interacting in the `Hanami::RSpec` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hanami/rspec/blob/main/CODE_OF_CONDUCT.md).
47
61
 
48
- See `LICENSE` file.
62
+ ## Copyright
49
63
 
64
+ Copyright © 2014-2022 Hanami Team – Released under MIT License
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "hanami/rspec"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/hanami-rspec.gemspec CHANGED
@@ -1,38 +1,38 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file is synced from hanakai-rb/repo-sync. To update it, edit repo-sync.yml.
4
-
5
- lib = File.expand_path("lib", __dir__)
6
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
- require "hanami/rspec/version"
3
+ require_relative "lib/hanami/rspec/version"
8
4
 
9
5
  Gem::Specification.new do |spec|
10
6
  spec.name = "hanami-rspec"
11
- spec.authors = ["Hanakai team"]
12
- spec.email = ["info@hanakai.org"]
13
- spec.license = "MIT"
14
- spec.version = Hanami::RSpec::VERSION.dup
7
+ spec.version = Hanami::RSpec::VERSION
8
+ spec.authors = ["Luca Guidi"]
9
+ spec.email = ["me@lucaguidi.com"]
15
10
 
16
- spec.summary = "Hanami RSpec generators and CLI commands"
17
- spec.description = spec.summary
11
+ spec.summary = "Hanami RSpec"
12
+ spec.description = "Hanami RSpec generators and Rake tasks"
18
13
  spec.homepage = "https://hanamirb.org"
19
- spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "hanami-rspec.gemspec", "lib/**/*"]
20
- spec.bindir = "exe"
21
- spec.executables = Dir["exe/*"].map { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
23
16
 
24
- spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE"]
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
25
18
 
26
- spec.metadata["changelog_uri"] = "https://github.com/hanami/hanami-rspec/blob/main/CHANGELOG.md"
27
- spec.metadata["source_code_uri"] = "https://github.com/hanami/hanami-rspec"
28
- spec.metadata["bug_tracker_uri"] = "https://github.com/hanami/hanami-rspec/issues"
29
- spec.metadata["funding_uri"] = "https://github.com/sponsors/hanami"
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/hanami/rspec"
21
+ spec.metadata["changelog_uri"] = "https://github.com/hanami/rspec/blob/master/CHANGELOG.md"
30
22
 
31
- spec.required_ruby_version = ">= 3.3"
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
32
31
 
33
- spec.add_runtime_dependency "hanami-cli", "~> 3.0.0"
34
- spec.add_runtime_dependency "rspec", "~> 3.12"
35
- spec.add_runtime_dependency "rake", "~> 13.0"
36
- spec.add_runtime_dependency "zeitwerk", "~> 2.6"
37
- end
32
+ spec.add_dependency "hanami-cli", "~> 2.0.0.beta"
33
+ spec.add_dependency "rspec", "~> 3.11"
34
+ spec.add_dependency "rake", "~> 13.0"
38
35
 
36
+ spec.add_development_dependency "rubocop", "~> 1.11"
37
+ spec.metadata["rubygems_mfa_required"] = "true"
38
+ end