rspec-stubbed_env 1.0.16 → 1.0.17

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: c20d2c0480db9e2e47ce60b7ddbaa6ee9e9714c73347a3489bcf78dc67a573e7
4
- data.tar.gz: 8037345139c346559763d4817e9614947ec1d7c335a26e9e15a71ead8c6caba6
3
+ metadata.gz: 4f2902dac6f65ba1dea2ddc2a793451bee933d8b2238ed28dc42b82240382580
4
+ data.tar.gz: 07aea66f238e7d75130348da683999aabe0f9ac23eada29c2e4b72e26dec6f38
5
5
  SHA512:
6
- metadata.gz: dbf880e0a6719538492db3a1845721414d18bfd27983b017c13b87b4560d16c5d8d007483bad5a66721b33e179fb354ea417d6b7f99dbf99434c615ffb031708
7
- data.tar.gz: '070608911197383c58184e70573411fedd749478e58367190078ffd14318a9b149bb5db89f18185e33c43589ecc8c8d74b4e814c838f66bd71571a5f52269034'
6
+ metadata.gz: b6bde6720288d1ddc2c376887d107052164b108d7abf1122f3142a07dcf699291c6ba326402f163fef247868b683a668976f4988e16479c7786c9fd1ed89607a
7
+ data.tar.gz: 659ce79a6d6200ec6e66825ed9091fb97179a40951f4a966193ddd54f871e1337ac438c48f02db2aa6154ec83e4ba6a2429c4b04df3c9f53b35532c46db4741d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,29 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [1.0.17] - 2026-10-13
34
+
35
+ - TAG: [v1.0.17][1.0.17t]
36
+ - COVERAGE: 100.00% -- 84/84 lines in 5 files
37
+ - BRANCH COVERAGE: 100.00% -- 31/31 branches in 5 files
38
+ - 75.00% documented
39
+
40
+ ### Changed
41
+
42
+ - [kc] kettle-jem/prepare: updated 37 project files:
43
+ - configuration (1)
44
+ - dependencies (36)
45
+ - [kc] kettle-jem/template: updated 21 project files:
46
+ - code and tests (4)
47
+ - dependencies (2)
48
+ - documentation (2)
49
+ - other (2)
50
+ - workflows (11)
51
+
52
+ ### Fixed
53
+
54
+ - Re-stubbing the same ENV key across examples no longer raises "message expectation ... has already been invoked and cannot be modified further": ENV accessors are stubbed with one block-backed receive per accessor reading a mutation ledger, instead of per-key .with(key) expectations that collide after invocation (observed as a seed-dependent failure on kettle-dev's jruby-9.2 CI lane)
55
+
33
56
  ## [1.0.16] - 2026-10-01
34
57
 
35
58
  - TAG: [v1.0.16][1.0.16t]
@@ -390,7 +413,9 @@ Please file a bug if you notice a violation of semantic versioning.
390
413
  [@darhazer]: https://github.com/darhazer
391
414
  [@hosamaly]: https://github.com/hosamaly
392
415
 
393
- [Unreleased]: https://github.com/galtzo-floss/rspec-stubbed_env/compare/v1.0.16...HEAD
416
+ [Unreleased]: https://github.com/galtzo-floss/rspec-stubbed_env/compare/v1.0.17...HEAD
417
+ [1.0.17]: https://github.com/galtzo-floss/rspec-stubbed_env/compare/v1.0.16...v1.0.17
418
+ [1.0.17t]: https://github.com/galtzo-floss/rspec-stubbed_env/releases/tag/v1.0.17
394
419
  [1.0.16]: https://github.com/galtzo-floss/rspec-stubbed_env/compare/v1.0.15...v1.0.16
395
420
  [1.0.16t]: https://github.com/galtzo-floss/rspec-stubbed_env/releases/tag/v1.0.16
396
421
  [1.0.15]: https://github.com/galtzo-floss/rspec-stubbed_env/compare/v1.0.14...v1.0.15
data/README.md CHANGED
@@ -71,7 +71,7 @@ due to the inherent limitations of GitHub Actions.
71
71
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
72
72
  |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
73
73
  | Works with JRuby | [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎jruby-9.2-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎jruby-9.3-wf] <br/> [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎jruby-9.4-wf] [![JRuby 10.0 Compat][💎jruby-10.0i]][🚎jruby-10.0-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
74
- | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎truby-23.0-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf]|
74
+ | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
75
75
  | Works with MRI Ruby 4 | [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
76
76
  | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
77
77
  | Works with MRI Ruby 2 | ![Ruby 2.0 Compat][💎ruby-2.0i] ![Ruby 2.1 Compat][💎ruby-2.1i] ![Ruby 2.2 Compat][💎ruby-2.2i] ![Ruby 2.3 Compat][💎ruby-2.3i] <br/> [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
@@ -112,6 +112,23 @@ The _amazing_ test matrix is powered by the kettle-dev stack.
112
112
 
113
113
  </details>
114
114
 
115
+ ### Runtime and Platform Support
116
+
117
+ Support tiers describe what this project's CI actually exercises, not what may
118
+ work in an untested environment:
119
+
120
+ - **Parallel support**: CI runs the test suite with multiple workers available.
121
+ - **Unsupported**: the engine/platform combination is not covered by CI and is
122
+ not a project compatibility claim.
123
+
124
+ | Ruby engine/version | Linux | macOS | Windows | Notes |
125
+ |---------------------|-------|-------|---------|-------|
126
+ | MRI 3.1-3.4 | Parallel support | Unsupported | Unsupported | Versioned Ruby workflows run on Linux. |
127
+ | MRI current | Parallel support | Parallel support | Unsupported | Current Ruby workflow covers the declared OS platforms. |
128
+ | MRI head | Parallel support | Unsupported | Unsupported | CI is allowed to fail while Ruby is in development. |
129
+ | JRuby (all CI lanes) | Parallel support | Unsupported | Unsupported | Engine workflows run on Linux; macOS and Windows are not exercised by CI. |
130
+ | TruffleRuby (all CI lanes) | Parallel support | Unsupported | Unsupported | Never shipped a Windows build (zero Windows assets across 66 releases scanned 2026-10-10); setup-ruby hard-fails ([source](https://github.com/ruby/setup-ruby/blob/master/README.md)) |
131
+
115
132
  ### Federated DVCS
116
133
 
117
134
  <details markdown="1">
@@ -611,7 +628,6 @@ Thanks for RTFM. ☺️
611
628
  [🚎jruby-9.4-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/jruby-9.4.yml
612
629
  [🚎jruby-10.0-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/jruby-10.0.yml
613
630
  [🚎truby-22.3-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/truffleruby-22.3.yml
614
- [🚎truby-23.0-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/truffleruby-23.0.yml
615
631
  [🚎truby-23.1-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/truffleruby-23.1.yml
616
632
  [🚎truby-24.2-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/truffleruby-24.2.yml
617
633
  [🚎truby-25.0-wf]: https://github.com/galtzo-floss/rspec-stubbed_env/actions/workflows/truffleruby-25.0.yml
@@ -654,13 +670,11 @@ Thanks for RTFM. ☺️
654
670
  [💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
655
671
  [💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
656
672
  [💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
657
- [💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
658
673
  [💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
659
674
  [💎truby-24.2i]: https://img.shields.io/badge/Truffle_Ruby-24.2-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
660
675
  [💎truby-25.0i]: https://img.shields.io/badge/Truffle_Ruby-25.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
661
676
  [💎truby-33.0i]: https://img.shields.io/badge/Truffle_Ruby-33.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
662
677
  [💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
663
- [💎truby-headi]: https://img.shields.io/badge/Truffle_Ruby-HEAD-34BCB1?style=for-the-badge&logo=ruby&logoColor=blue
664
678
  [💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
665
679
  [💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
666
680
  [💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
@@ -693,7 +707,7 @@ Thanks for RTFM. ☺️
693
707
  [📌gitmoji]: https://gitmoji.dev
694
708
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
695
709
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
696
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.094-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
710
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.084-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
697
711
  [🔐security]: https://github.com/galtzo-floss/rspec-stubbed_env/blob/main/SECURITY.md
698
712
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
699
713
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -48,29 +48,6 @@ module RSpec
48
48
  def add_hidden_key(key)
49
49
  key = key.to_s # Support symbols by forcing to string
50
50
  remember_hidden_key(key)
51
- hide_brackets(key)
52
- hide_fetch(key)
53
- hide_values_at
54
- end
55
-
56
- def hide_brackets(key)
57
- allow(ENV).to(receive(:[]).with(key).and_return(nil))
58
- end
59
-
60
- def hide_fetch(key)
61
- allow(ENV).to(receive(:fetch).with(key)) do |_|
62
- raise KeyError, "key not found: \"#{key}\""
63
- end
64
- allow(ENV).to(receive(:fetch).with(key, anything)) do |_, default_val|
65
- default_val
66
- end
67
- end
68
-
69
- # Rides on the fetch hider!
70
- def hide_values_at
71
- allow(ENV).to(receive(:values_at)) do |*args|
72
- args.map { |arg| ENV.fetch(arg, nil) }
73
- end
74
51
  end
75
52
  end
76
53
  end
@@ -55,48 +55,50 @@ module RSpec
55
55
  allow(ENV).to(receive(:to_h) { mixed_env_hash })
56
56
  end
57
57
 
58
- private
59
-
60
- STUBBED_KEY = "__STUBBED__"
61
-
62
- def add_stubbed_value(key, value, track: true)
63
- key = key.to_s # Support symbols by forcing to string
64
- remember_stubbed_value(key, value) if track
65
- allow_brackets(key, value)
66
- allow_fetch(key, value)
67
- allow_values_at
58
+ def env_stubbed?
59
+ instance_variable_defined?(:@__rspec_stubbed_env_mutations) && !@__rspec_stubbed_env_mutations.empty?
68
60
  end
69
61
 
70
- def allow_brackets(key, value)
71
- allow(ENV).to(receive(:[]).with(key).and_return(value))
62
+ def init_stub
63
+ @__rspec_stubbed_env_mutations ||= []
64
+ install_env_accessors
65
+ add_stubbed_value(STUBBED_KEY, true, :track => false)
72
66
  end
73
67
 
74
- def allow_fetch(key, value)
75
- allow(ENV).to(receive(:fetch).with(key).and_return(value))
76
- allow(ENV).to(receive(:fetch).with(key, anything)) do |_, default_val|
77
- value || default_val
78
- end
79
- end
68
+ # Install ONE block-backed receive per accessor instead of per-key
69
+ # `.with(key)` expectations. Per-key expectations collide when the same
70
+ # key is stubbed again in a later example after the earlier expectation
71
+ # has been invoked — rspec-mocks raises "message expectation ... has
72
+ # already been invoked and cannot be modified further" (observed as a
73
+ # seed-dependent CI failure). The blocks read the mutation ledger at
74
+ # call time, so later stub_env / hide_env calls only append to it.
75
+ def install_env_accessors
76
+ allow(ENV).to(receive(:[]) { |key| mixed_env_hash[key] })
77
+ allow(ENV).to(receive(:fetch) do |key, *rest, &default_block|
78
+ hidden = @__rspec_stubbed_env_mutations.reverse.any? do |op, k, _|
79
+ op == :hide && k == key
80
+ end
81
+ value = mixed_env_hash[key]
82
+ if hidden && value.nil?
83
+ unless rest.empty?
84
+ next rest.first
85
+ end
86
+ next default_block.call if default_block
87
+
88
+ raise KeyError, %(key not found: "#{key}")
89
+ end
90
+ if value.nil?
91
+ next rest.first unless rest.empty?
92
+ next default_block.call if default_block
93
+ end
80
94
 
81
- # Rides on the fetch stub!
82
- def allow_values_at
95
+ value
96
+ end)
83
97
  allow(ENV).to(receive(:values_at)) do |*args|
84
- args.map { |arg| ENV.fetch(arg, nil) }
98
+ args.map { |arg| mixed_env_hash[arg] }
85
99
  end
86
100
  end
87
101
 
88
- def env_stubbed?
89
- ENV.fetch(STUBBED_KEY, nil)
90
- end
91
-
92
- def init_stub
93
- @__rspec_stubbed_env_mutations ||= []
94
- allow(ENV).to(receive(:[]).and_call_original)
95
- allow(ENV).to(receive(:fetch).and_call_original)
96
- allow(ENV).to(receive(:values_at).and_call_original)
97
- add_stubbed_value(STUBBED_KEY, true, :track => false)
98
- end
99
-
100
102
  def remember_stubbed_value(key, value)
101
103
  @__rspec_stubbed_env_mutations ||= []
102
104
  @__rspec_stubbed_env_mutations << [:stub, key, value]
@@ -118,6 +120,15 @@ module RSpec
118
120
  end
119
121
  end
120
122
  end
123
+
124
+ private
125
+
126
+ STUBBED_KEY = "__STUBBED__"
127
+
128
+ def add_stubbed_value(key, value, track: true)
129
+ key = key.to_s # Support symbols by forcing to string
130
+ remember_stubbed_value(key, value) if track
131
+ end
121
132
  end
122
133
  end
123
134
  end
@@ -5,7 +5,7 @@ module RSpec
5
5
  # Version namespace for this gem.
6
6
  module Version
7
7
  # Current gem version.
8
- VERSION = "1.0.16"
8
+ VERSION = "1.0.17"
9
9
  end
10
10
  # Current gem version exposed at the traditional constant location.
11
11
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-stubbed_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -48,7 +48,7 @@ dependencies:
48
48
  version: '3.1'
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: 3.1.5
51
+ version: 3.1.11
52
52
  type: :development
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  version: '3.1'
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 3.1.5
61
+ version: 3.1.11
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: bundler-audit
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ dependencies:
156
156
  version: '2.0'
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 2.0.23
159
+ version: 2.0.24
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
@@ -166,7 +166,7 @@ dependencies:
166
166
  version: '2.0'
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 2.0.23
169
+ version: 2.0.24
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: turbo_tests2
172
172
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ dependencies:
176
176
  version: '3.2'
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 3.2.12
179
+ version: 3.2.14
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ dependencies:
186
186
  version: '3.2'
187
187
  - - ">="
188
188
  - !ruby/object:Gem::Version
189
- version: 3.2.12
189
+ version: 3.2.14
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: ruby-progressbar
192
192
  requirement: !ruby/object:Gem::Requirement
@@ -230,7 +230,7 @@ dependencies:
230
230
  version: '2.0'
231
231
  - - ">="
232
232
  - !ruby/object:Gem::Version
233
- version: 2.0.13
233
+ version: 2.0.15
234
234
  type: :development
235
235
  prerelease: false
236
236
  version_requirements: !ruby/object:Gem::Requirement
@@ -240,7 +240,7 @@ dependencies:
240
240
  version: '2.0'
241
241
  - - ">="
242
242
  - !ruby/object:Gem::Version
243
- version: 2.0.13
243
+ version: 2.0.15
244
244
  - !ruby/object:Gem::Dependency
245
245
  name: rspec
246
246
  requirement: !ruby/object:Gem::Requirement
@@ -305,10 +305,10 @@ licenses:
305
305
  - MIT
306
306
  metadata:
307
307
  homepage_uri: https://rspec-stubbed-env.galtzo.com/
308
- source_code_uri: https://github.com/galtzo-floss/rspec-stubbed_env/tree/v1.0.16
309
- changelog_uri: https://github.com/galtzo-floss/rspec-stubbed_env/blob/v1.0.16/CHANGELOG.md
308
+ source_code_uri: https://github.com/galtzo-floss/rspec-stubbed_env/tree/v1.0.17
309
+ changelog_uri: https://github.com/galtzo-floss/rspec-stubbed_env/blob/v1.0.17/CHANGELOG.md
310
310
  bug_tracker_uri: https://github.com/galtzo-floss/rspec-stubbed_env/issues
311
- documentation_uri: https://www.rubydoc.info/gems/rspec-stubbed_env/1.0.16
311
+ documentation_uri: https://www.rubydoc.info/gems/rspec-stubbed_env/1.0.17
312
312
  funding_uri: https://github.com/sponsors/pboling
313
313
  wiki_uri: https://github.com/galtzo-floss/rspec-stubbed_env/wiki
314
314
  news_uri: https://www.railsbling.com/tags/rspec-stubbed_env
metadata.gz.sig CHANGED
Binary file