hanami-minitest 3.0.0.rc1 → 3.0.0

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: ecb2a53d8cbcc2ca342732ce92f727c1512a833b31cbc854e6a72cca74f44dfd
4
- data.tar.gz: b84c14c29262f12aee015437ee83a90d69e7380e287a066cb45d1222e3c22e3c
3
+ metadata.gz: ca04ed88be7b43328135fcb60b8c5f8fa04c27b3a051b30c828c0234ad9799b3
4
+ data.tar.gz: 04aa896a94262f0117af46cbac9b5da95b9d0a6ef3f401474a3ee8ecc0e8fbeb
5
5
  SHA512:
6
- metadata.gz: 4527b3500752a8ab6f6cd6c7b1a2685decfdcdb0af0ab3f6116760c16b01ffa633b4fe38a0638822a7b87a0543208174025ca18b7003f1949d7fb6f2e7ec88a2
7
- data.tar.gz: 25e7b28c6ac92c68c28c0098691d406e7cbab10dd5e1667690963f19d3291f069dce698ea4c87d46c7f102e40f06be049e65369f8e9481b51d127f11b6d60b40
6
+ metadata.gz: c0d28fba6c1cc7edb6a67e2d2697733cebdc4274018df9712b39619a2bbcf0d788f8748e22a9b4feee81c6ee82960980aa74437379b110a9cad244cd87cd8f61
7
+ data.tar.gz: f896b458d7aec6a39e04a8cd1f9d88083210ece3da736cdd792dfb2e05ead8451c63ca116270373bf989c8ca7bc2586d9d88bf6fa3b75616692e1a6eaa6f8e78
data/CHANGELOG.md CHANGED
@@ -19,7 +19,15 @@ 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.rc1...HEAD
22
+ [Unreleased]: https://github.com/hanami/hanami-minitest/compare/v3.0.0...HEAD
23
+
24
+ ## [3.0.0] - 2026-06-30
25
+
26
+ ### Added
27
+
28
+ - Create the gem. (@timriley)
29
+
30
+ [3.0.0]: https://github.com/hanami/hanami-minitest/releases/tag/v3.0.0
23
31
 
24
32
  ## [3.0.0.rc1] - 2026-06-16
25
33
 
@@ -30,6 +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
34
  spec.add_runtime_dependency "minitest", "~> 5.25"
34
35
  spec.add_runtime_dependency "zeitwerk", "~> 2.6"
35
36
  spec.add_development_dependency "bundler"
@@ -15,6 +15,7 @@ module Hanami
15
15
  copy_support_db
16
16
  copy_support_features
17
17
  copy_support_operations
18
+ copy_support_mailers
18
19
  copy_support_requests
19
20
 
20
21
  generate_request_test
@@ -80,6 +81,15 @@ module Hanami
80
81
  )
81
82
  end
82
83
 
84
+ def copy_support_mailers
85
+ return unless Hanami.bundled?("hanami-mailer")
86
+
87
+ fs.cp(
88
+ fs.expand_path(fs.join("generators", "templates", "support_mailers.rb"), __dir__),
89
+ fs.expand_path(fs.join("test", "support", "mailers.rb"))
90
+ )
91
+ end
92
+
83
93
  def copy_support_requests
84
94
  fs.cp(
85
95
  fs.expand_path(fs.join("generators", "templates", "support_requests.rb"), __dir__),
@@ -41,6 +41,8 @@ module Hanami
41
41
  header: ["# frozen_string_literal: true", "", 'require "test_helper"'],
42
42
  parent_class_name: "Hanami::Minitest::Test",
43
43
  body: <<~RUBY.lines(chomp: true)
44
+ include TestSupport::Mailers
45
+
44
46
  # Inspect the delivered message to assert on its contents:
45
47
  #
46
48
  # assert_equal ["recipient@example.com"], result.message.to
@@ -55,15 +55,11 @@ module TestSupport
55
55
  end
56
56
 
57
57
  def all_databases
58
- @all_databases ||= begin
59
- slices = [Hanami.app] + Hanami.app.slices.with_nested
58
+ @all_databases ||= Hanami.app.with_slices.each_with_object([]) { |slice, dbs|
59
+ next unless slice.key?("db.rom")
60
60
 
61
- slices.each_with_object([]) { |slice, dbs|
62
- next unless slice.key?("db.rom")
63
-
64
- dbs.concat slice["db.rom"].gateways.values.map(&:connection)
65
- }.uniq
66
- end
61
+ dbs.concat slice["db.rom"].gateways.values.map(&:connection)
62
+ }.uniq
67
63
  end
68
64
  end
69
65
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Reset recorded mail deliveries between tests.
4
+ #
5
+ # In the test env, mail is delivered via a shared test delivery method, so recorded
6
+ # deliveries accumulate across tests. Include this module in any test that sends mail
7
+ # to start with a clean slate:
8
+ #
9
+ # class Mailers::WelcomeTest < Hanami::Minitest::Test
10
+ # include TestSupport::Mailers
11
+ # # ...
12
+ # end
13
+ module TestSupport
14
+ module Mailers
15
+ def setup
16
+ Hanami.app.with_slices.each do |slice|
17
+ next unless slice.key?("mailers.delivery_method")
18
+
19
+ slice["mailers.delivery_method"].clear
20
+ end
21
+
22
+ super
23
+ end
24
+ end
25
+ 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.rc1"
8
+ VERSION = "3.0.0"
9
9
  end
10
10
  end
@@ -44,7 +44,7 @@ module Hanami
44
44
  Hanami::CLI.after "generate operation", Commands::Generate::Operation
45
45
  end
46
46
 
47
- if Hanami.bundled?("hanami-controller")
47
+ if Hanami.bundled?("hanami-action")
48
48
  Hanami::CLI.after "generate action", Commands::Generate::Action
49
49
  end
50
50
 
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.rc1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: hanami-cli
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: 3.0.0
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: 3.0.0
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: minitest
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +124,7 @@ files:
110
124
  - lib/hanami/minitest/generators/templates/support_db.rb
111
125
  - lib/hanami/minitest/generators/templates/support_db_cleaning.rb
112
126
  - lib/hanami/minitest/generators/templates/support_features.rb
127
+ - lib/hanami/minitest/generators/templates/support_mailers.rb
113
128
  - lib/hanami/minitest/generators/templates/support_minitest.rb
114
129
  - lib/hanami/minitest/generators/templates/support_operations.rb
115
130
  - lib/hanami/minitest/generators/templates/support_requests.rb
@@ -139,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
154
  - !ruby/object:Gem::Version
140
155
  version: '0'
141
156
  requirements: []
142
- rubygems_version: 4.0.14
157
+ rubygems_version: 3.6.9
143
158
  specification_version: 4
144
159
  summary: Minitest support for Hanami.
145
160
  test_files: []