rspec-stubbed_env 1.0.0 → 1.0.2

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.
data/README.md CHANGED
@@ -1,66 +1,141 @@
1
1
  # RSpec::StubbedEnv
2
2
 
3
- ENV stubbing via a shared context for more powerful tests.
3
+ [![Version][👽versioni]][👽version]
4
+ [![License: MIT][📄license-img]][📄license-ref]
5
+ [![Downloads Rank][👽dl-ranki]][👽dl-rank]
6
+ [![Open Source Helpers][👽oss-helpi]][👽oss-help]
7
+ [![Depfu][🔑depfui♻️]][🔑depfu]
8
+ [![CodeCov Test Coverage][🔑codecovi♻️]][🔑codecov]
9
+ [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls]
10
+ [![CodeClimate Test Coverage][🔑cc-covi♻️]][🔑cc-cov]
11
+ [![Maintainability][🔑cc-mnti♻️]][🔑cc-mnt]
12
+ [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf]
13
+ [![CI Current][🚎11-c-wfi]][🚎11-c-wf]
14
+ [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf]
15
+ [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf]
16
+ [![CI Supported][🚎6-s-wfi]][🚎6-s-wf]
17
+ [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf]
18
+ [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf]
19
+ [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf]
20
+ [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf]
21
+ [![CI Style][🚎5-st-wfi]][🚎5-st-wf]
22
+
23
+ ---
24
+
25
+ [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
26
+ [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
27
+ [![Buy me a coffee][🖇buyme-small-img]][🖇buyme]
28
+ [![Donate on Polar][🖇polar-img]][🖇polar]
29
+ [![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
30
+ [![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
31
+
32
+ ENV stubbing via a shared context for more powerful tests. Now you don't need to add dotenv just for your spec suite.
33
+ ENV hiding via `hide_env("FOO")` was added in v1.0.2.
4
34
 
5
35
  ```ruby
6
- describe 'my stubbed test' do
7
- include_context 'with stubbed env'
8
- before do
9
- stub_env('FOO' => 'is bar')
36
+ describe "my stubbed test" do
37
+ include_context "with stubbed env"
38
+ include_context "with hidden env"
39
+ context "with FOO=is bar" do
40
+ before do
41
+ stub_env("FOO" => "is bar")
42
+ end
43
+ it "has a value" do
44
+ expect(ENV.fetch("FOO", nil)).to(eq("is bar"))
45
+ expect(ENV.fetch("FOO")).to(eq("is bar"))
46
+ expect(ENV["FOO"]).to(eq("is bar"))
47
+ end
10
48
  end
11
- it 'has a value' do
12
- expect(ENV['FOO']).to eq('is bar')
49
+ context "without BAR set" do
50
+ before do
51
+ hide_env("BAR")
52
+ end
53
+ it "is nil" do
54
+ expect(ENV.fetch("BAR", nil)).to(be_nil)
55
+ expect(ENV["BAR"]).to(be_nil)
56
+ end
57
+ it "raises error" do
58
+ expect { ENV.fetch("BAR") }.to(raise_error(KeyNotFound))
59
+ end
13
60
  end
14
61
  end
15
62
  ```
16
63
 
17
- | Project | RSpec::StubbedEnv |
18
- |------------------------ | ----------------------- |
19
- | gem name | [rspec-stubbed_env](https://rubygems.org/gems/rspec-stubbed_env) |
20
- | license | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) |
21
- | download rank | [![Downloads Today](https://img.shields.io/gem/rd/rspec-stubbed_env.svg)](https://github.com/pboling/rspec-stubbed_env) |
22
- | version | [![Version](https://img.shields.io/gem/v/rspec-stubbed_env.svg)](https://rubygems.org/gems/rspec-stubbed_env) |
23
- | continuous integration | [![Build Status](https://travis-ci.org/pboling/rspec-stubbed_env.svg?branch=master)](https://travis-ci.org/pboling/rspec-stubbed_env) |
24
- | test coverage | [![Test Coverage](https://api.codeclimate.com/v1/badges/07a1d53634c61154efae/test_coverage)](https://codeclimate.com/github/pboling/rspec-stubbed_env/test_coverage) |
25
- | maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/07a1d53634c61154efae/maintainability)](https://codeclimate.com/github/pboling/rspec-stubbed_env/maintainability) |
26
- | dependencies | [![Depfu](https://badges.depfu.com/badges/a48948dd503f23a440f2c17910563f43/count.svg)](https://depfu.com/github/pboling/rspec-stubbed_env?project_id=5884) |
27
- | code triage | [![Open Source Helpers](https://www.codetriage.com/pboling/rspec-stubbed_env/badges/users.svg)](https://www.codetriage.com/pboling/rspec-stubbed_env) |
28
- | homepage | [on Github.com][homepage], [on Railsbling.com][blogpage] |
29
- | documentation | [on RDoc.info][documentation] |
30
- | Spread ~♡ⓛⓞⓥⓔ♡~ | [🌍 🌎 🌏](https://about.me/peter.boling), [🍚](https://www.crowdrise.com/helprefugeeswithhopefortomorrowliberia/fundraiser/peterboling), [➕](https://plus.google.com/+PeterBoling/posts), [👼](https://angel.co/peter-boling), [🐛](https://www.topcoder.com/members/pboling/), [:shipit:](http://coderwall.com/pboling), [![Tweet Peter](https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow)](http://twitter.com/galtzo) |
64
+ This gem has no runtime dependencies.
31
65
 
66
+ | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
67
+ |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
68
+ | Works with JRuby | [![JRuby 9.1 Compat][💎jruby-9.1i]][🚎10-j-wf] [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎10-j-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎10-j-wf] [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎10-j-wf] [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
69
+ | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎9-t-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎9-t-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf] |
70
+ | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎4-lg-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎6-s-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
71
+ | Works with MRI Ruby 2 | [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎1-an-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
72
+ | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
73
+ | Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![HEAD on RubyDoc.info][📜docs-head-rd-img]][🚎yard-head] [![BDFL Blog][🚂bdfl-blog-img]][🚂bdfl-blog] [![Wiki][📜wiki-img]][📜wiki] |
74
+ | Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] |
75
+ | Expert 1:1 Support | [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] `or` [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
76
+ | Enterprise Support | [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]<br/>💡Subscribe for support guarantees covering _all_ FLOSS dependencies!<br/>💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]!<br/>💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers! |
77
+ | Comrade BDFL 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact BDFL][🚂bdfl-contact-img]][🚂bdfl-contact] [![My technical writing][💖💁🏼‍♂️devto-img]][💖💁🏼‍♂️devto] |
78
+ | `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼‍♂️aboutme-img]][💖💁🏼‍♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
32
79
 
33
- ## Installation
80
+ ## Installation
34
81
 
35
- Add this line to your application's Gemfile:
82
+ Install the gem and add to the application's Gemfile by executing:
36
83
 
37
- ```ruby
38
- gem 'rspec-stubbed_env', group: :test
84
+ $ bundle add rspec-stubbed_env
85
+
86
+ If bundler is not being used to manage dependencies, install the gem by executing:
87
+
88
+ $ gem install rspec-stubbed_env
89
+
90
+ ### 🔒 Secure Installation
91
+
92
+ `rspec-stubbed_env` is cryptographically signed, and with verifiable [SHA-256 and SHA-512][💎SHA_checksums] checksums by
93
+ [stone_checksums][💎stone_checksums]. Be sure the gem you install hasn’t been tampered with
94
+ by following the instructions below.
95
+
96
+ Add my public key (if you haven’t already, expires 2045-04-29) as a trusted certificate:
97
+
98
+ ```shell
99
+ gem cert --add <(curl -Ls https://raw.github.com/oauth-xx/rspec-stubbed_env/main/certs/pboling.pem)
39
100
  ```
40
101
 
41
- And then execute:
102
+ You only need to do that once. Then proceed to install with:
42
103
 
43
- $ bundle
104
+ ```shell
105
+ gem install rspec-stubbed_env -P HighSecurity
106
+ ```
44
107
 
45
- Or install it yourself as:
108
+ The `HighSecurity` trust profile will verify signed gems, and not allow the installation of unsigned dependencies.
46
109
 
47
- $ gem install rspec-stubbed_env
110
+ If you want to up your security game full-time:
48
111
 
112
+ ```shell
113
+ bundle config set --global trust-policy MediumSecurity
114
+ ```
115
+
116
+ `MediumSecurity` instead of `HighSecurity` is necessary if not all the gems you use are signed.
117
+
118
+ NOTE: Be prepared to track down certs for signed gems and add them the same way you added mine.
119
+
120
+ ## 🔧 Basic Usage
49
121
 
50
122
  You must configure RSpec to use the `:expect` syntax, or some compatible alternative.
51
123
 
52
124
  ```ruby
53
125
  RSpec.configure do |config|
54
- config.expect_with :rspec do |c|
126
+ config.expect_with(:rspec) do |c|
55
127
  c.syntax = :expect
56
128
  end
57
129
  end
58
130
  ```
59
131
 
60
- ## Usage
132
+ Require the library in your spec/test helper somewhere:
133
+ ```ruby
134
+ require "rspec/stubbed_env"
135
+ ```
136
+
137
+ ### ENV stubbing
61
138
 
62
- ENV stubbing:
63
-
64
139
  - is opt-in, via a shared context, rather than global.
65
140
  - *does not* affect the real ENV at all. It is a true stub.
66
141
  - has the same scope as a `before`, `subject`, or `let` at the same level.
@@ -69,67 +144,390 @@ See the spec suite for detailed examples.
69
144
 
70
145
  ```ruby
71
146
  # This is normal, without stubbing, ENV is not set
72
- describe 'vanilla' do
73
- it 'has no ENV stub' do
74
- expect(ENV['FOO']).to be_nil
147
+ describe "vanilla" do
148
+ it "has no ENV stub" do
149
+ expect(ENV.fetch("FOO", nil)).to(be_nil)
150
+ expect(ENV["FOO"]).to(be_nil)
75
151
  end
76
152
  end
77
153
 
78
154
  # With a stubbed ENV!
79
- describe 'my stubbed test' do
80
- include_context 'with stubbed env'
155
+ describe "my stubbed test" do
156
+ include_context "with stubbed env"
81
157
  before do
82
- stub_env('FOO' => 'is bar')
158
+ stub_env("FOO" => "is bar")
83
159
  end
84
- it 'has a value' do
85
- expect(ENV['FOO']).to eq('is bar')
160
+ it "has a value" do
161
+ expect(ENV.fetch("FOO", nil)).to(eq("is bar"))
162
+ expect(ENV["FOO"]).to(eq("is bar"))
86
163
  end
87
164
  end
88
165
  ```
89
166
 
90
- ## Development
167
+ ENV can be stubbed trough the `stub_env` method, or key/value pairs to be stubbed can be
168
+ provided directly to the `include_context` call:
91
169
 
92
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
170
+ ```ruby
171
+ describe "my stubbed test" do
172
+ include_context "with stubbed env", "FOO" => "is bar"
93
173
 
94
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
174
+ it "has a value" do
175
+ expect(ENV.fetch("FOO", nil)).to(eq("is bar"))
176
+ expect(ENV["FOO"]).to(eq("is bar"))
177
+ end
178
+ end
179
+ ```
95
180
 
96
- ## Contributing
181
+ If you want to make `stub_env` method available globally (without the `include_context` call),
182
+ you can add in the `spec_helper`.
97
183
 
98
- Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/rspec-stubbed_env.
184
+ I do not recommend the _global_ approach, as it results in a loss of clarity
185
+ on which tests are testing ENV-based behaviors. Here's a foot-gun if you want it.
99
186
 
100
- ## Code of Conduct
187
+ ```ruby
188
+ RSpec.configure do |config|
189
+ config.include(RSpec::StubbedEnv::StubHelpers)
190
+ # Or you could include the context globally
191
+ # config.include_context "with stubbed env"
192
+ end
193
+ ```
101
194
 
102
- Everyone interacting in the AnonymousActiveRecord project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pboling/rspec-stubbed_env/blob/master/CODE_OF_CONDUCT.md).
195
+ ### ENV hiding
103
196
 
104
- ## Versioning
197
+ - is opt-in, via a shared context, rather than global.
198
+ - *does not* affect the real ENV at all. It is a true stub.
199
+ - has the same scope as a `before`, `subject`, or `let` at the same level.
105
200
 
106
- This library aims to adhere to [Semantic Versioning 2.0.0][semver].
107
- Violations of this scheme should be reported as bugs. Specifically,
108
- if a minor or patch version is released that breaks backward
109
- compatibility, a new version should be immediately released that
110
- restores compatibility. Breaking changes to the public API will
111
- only be introduced with new major versions.
201
+ See the spec suite for detailed examples.
112
202
 
113
- As a result of this policy, you can (and should) specify a
114
- dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
203
+ ```ruby
204
+ # This is normal, without hiding, ENV is set
205
+ ENV["MY_PATH"] = "/home/doodle"
206
+ describe "vanilla" do
207
+ it "has ENV with nothing hidden" do
208
+ expect(ENV.fetch("MY_PATH", nil)).to("/home/doodle")
209
+ expect(ENV["MY_PATH"]).to("/home/doodle")
210
+ end
211
+ end
115
212
 
116
- For example:
213
+ # With a hidden ENV variable!
214
+ describe "my hidden test" do
215
+ include_context "with hidden env"
216
+ before do
217
+ hide_env("MY_PATH")
218
+ end
219
+ it "MY_PATH is not set" do
220
+ expect(ENV.fetch("MY_PATH", nil)).to(be_nil)
221
+ expect(ENV["MY_PATH"]).to(be_nil)
222
+ end
223
+ end
224
+ ```
225
+
226
+ ENV variables can be hidden trough the `hide_env` method, or variable names to be hidden can be
227
+ provided directly to the `include_context` call:
117
228
 
118
229
  ```ruby
119
- spec.add_dependency 'rspec-stubbed_env', '~> 1.0'
230
+ describe "my hidden test" do
231
+ include_context "with hidden env", "MY_PATH"
232
+
233
+ it "MY_PATH is not set" do
234
+ expect(ENV.fetch("MY_PATH", nil)).to(be_nil)
235
+ expect(ENV["MY_PATH"]).to(be_nil)
236
+ end
237
+ end
120
238
  ```
121
239
 
122
- ## License
240
+ If you want to make `hide_env` method available globally (without the `include_context` call),
241
+ you can add in the `spec_helper`:
123
242
 
124
- * Copyright (c) 2018 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
243
+ I do not recommend the _global_ approach, as it results in a loss of clarity
244
+ on which tests are testing ENV-based behaviors. Here's a foot-gun if you want it.
125
245
 
126
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
246
+ ```ruby
247
+ RSpec.configure do |config|
248
+ config.include(RSpec::StubbedEnv::HideHelpers)
249
+ # Or you could include the context globally
250
+ # config.include_context "with hidden env"
251
+ end
252
+ ```
253
+
254
+ ## 🚚 Switch to `main` branch
255
+
256
+ We migrated from `master` to `main` as the default branch. If this affected your local checkout:
257
+
258
+ ```shell
259
+ git branch -m master main
260
+ git fetch origin
261
+ git branch -u origin/main main
262
+ git remote set-head origin -a
263
+ ```
264
+
265
+ ### 🚀 Release Instructions
266
+
267
+ See [CONTRIBUTING.md][🤝contributing].
268
+
269
+ ## 🔐 Security
270
+
271
+ See [SECURITY.md][🔐security].
272
+
273
+ ## 🤝 Contributing
274
+
275
+ If you need some ideas of where to help, you could work on adding more code coverage,
276
+ or if it is already 💯 (see [below](#code-coverage)) check TODOs (see [below](#todos)),
277
+ or check [issues][🤝issues], or [PRs][🤝pulls],
278
+ or use the gem and think about how it could be better.
279
+
280
+ We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you make changes, remember to update it.
281
+
282
+ See [CONTRIBUTING.md][🤝contributing] for more detailed instructions.
283
+
284
+ ### Code Coverage
285
+
286
+ [![Coverage Graph][🔑codecov-g♻️]][🔑codecov]
287
+
288
+ ### 🪇 Code of Conduct
289
+
290
+ Everyone interacting in this project's codebases, issue trackers,
291
+ chat rooms and mailing lists is expected to follow the [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct].
292
+
293
+ ## 🌈 Contributors
294
+
295
+ [![Contributors][🖐contributors-img]][🖐contributors]
296
+
297
+ Made with [contributors-img][🖐contrib-rocks].
298
+
299
+ Also see GitLab Contributors: [https://gitlab.com/pboling/rspec-stubbed_env/-/graphs/master][🚎contributors-gl]
300
+
301
+ ## ⭐️ Star History
302
+
303
+ <a href="https://star-history.com/#pboling/rspec-stubbed_env&Date">
304
+ <picture>
305
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pboling/rspec-stubbed_env&type=Date&theme=dark" />
306
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=pboling/rspec-stubbed_env&type=Date" />
307
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=pboling/rspec-stubbed_env&type=Date" />
308
+ </picture>
309
+ </a>
310
+
311
+ ## 📌 Versioning
312
+
313
+ This Library adheres to [![Semantic Versioning 2.0.0][📌semver-img]][📌semver].
314
+ Violations of this scheme should be reported as bugs.
315
+ Specifically, if a minor or patch version is released that breaks backward compatibility,
316
+ a new version should be immediately released that restores compatibility.
317
+ Breaking changes to the public API will only be introduced with new major versions.
318
+
319
+ ### 📌 Is "Platform Support" part of the public API?
320
+
321
+ Yes. But I'm obligated to include notes...
322
+
323
+ SemVer should, but doesn't explicitly, say that dropping support for specific Platforms
324
+ is a *breaking change* to an API.
325
+ It is obvious to many, but not all, and since the spec is silent, the bike shedding is endless.
326
+
327
+ > dropping support for a platform is both obviously and objectively a breaking change
328
+
329
+ - Jordan Harband (@ljharb, maintainer of SemVer) [in SemVer issue 716][📌semver-breaking]
330
+
331
+ To get a better understanding of how SemVer is intended to work over a project's lifetime,
332
+ read this article from the creator of SemVer:
333
+
334
+ - ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred]
335
+
336
+ As a result of this policy, and the interpretive lens used by the maintainer,
337
+ you can (and should) specify a dependency on these libraries using
338
+ the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
339
+
340
+ For example:
341
+
342
+ ```ruby
343
+ spec.add_dependency("rspec-stubbed_env", "~> 1.0")
344
+ ```
127
345
 
128
- [license]: LICENSE
129
- [semver]: http://semver.org/
130
- [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
131
- [railsbling]: http://www.railsbling.com
132
- [peterboling]: http://www.peterboling.com
133
- [documentation]: http://rdoc.info/github/pboling/rspec-stubbed_env/frames
134
- [homepage]: https://github.com/pboling/rspec-stubbed_env/
135
- [blogpage]: http://www.railsbling.com/tags/rspec-stubbed_env/
346
+ See [CHANGELOG.md][📌changelog] for list of releases.
347
+
348
+ ## 📄 License
349
+
350
+ The gem is available as open source under the terms of
351
+ the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-ref].
352
+ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer].
353
+
354
+ ### © Copyright
355
+
356
+ <p>
357
+ Copyright (c) 2018 - 2020, 2024 - 2025 Peter H. Boling,
358
+ <a href="https://railsbling.com">
359
+ RailsBling.com
360
+ <picture>
361
+ <img alt="Rails Bling" height="20" src="https://railsbling.com/images/logos/RailsBling-TrainLogo.svg" />
362
+ </picture>
363
+ </a>
364
+ </p>
365
+
366
+ ## 🤑 One more thing
367
+
368
+ You made it to the bottom of the page,
369
+ so perhaps you'll indulge me for another 20 seconds.
370
+ I maintain many dozens of gems, including this one,
371
+ because I want Ruby to be a great place for people to solve problems, big and small.
372
+ Please consider supporting my efforts via the giant yellow link below,
373
+ or one of the others at the head of this README.
374
+
375
+ [![Buy me a latte][🖇buyme-img]][🖇buyme]
376
+
377
+ [✇bundle-group-pattern]: https://gist.github.com/pboling/4564780
378
+ [⛳️gem-namespace]: https://github.com/pboling/rspec-stubbed_env
379
+ [⛳️namespace-img]: https://img.shields.io/badge/namespace-RSpec%3A%3AStubbedEnv-brightgreen.svg?style=flat&logo=ruby&logoColor=white
380
+ [⛳️gem-name]: https://rubygems.org/gems/rspec-stubbed_env
381
+ [⛳️name-img]: https://img.shields.io/badge/name-rspec--stubbed__env-brightgreen.svg?style=flat&logo=rubygems&logoColor=red
382
+ [🚂bdfl-blog]: http://www.railsbling.com/tags/rspec-stubbed_env
383
+ [🚂bdfl-blog-img]: https://img.shields.io/badge/blog-railsbling-0093D0.svg?style=for-the-badge&logo=rubyonrails&logoColor=orange
384
+ [🚂bdfl-contact]: http://www.railsbling.com/contact
385
+ [🚂bdfl-contact-img]: https://img.shields.io/badge/Contact-BDFL-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red
386
+ [💖🖇linkedin]: http://www.linkedin.com/in/peterboling
387
+ [💖🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-LinkedIn-0B66C2?style=flat&logo=newjapanprowrestling
388
+ [💖✌️wellfound]: https://angel.co/u/peter-boling
389
+ [💖✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=flat&logo=wellfound
390
+ [💖💲crunchbase]: https://www.crunchbase.com/person/peter-boling
391
+ [💖💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=flat&logo=crunchbase
392
+ [💖🐘ruby-mast]: https://ruby.social/@galtzo
393
+ [💖🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=flat&logo=mastodon&label=Ruby%20%40galtzo
394
+ [💖🦋bluesky]: https://bsky.app/profile/galtzo.com
395
+ [💖🦋bluesky-img]: https://img.shields.io/badge/@galtzo.com-0285FF?style=flat&logo=bluesky&logoColor=white
396
+ [💖🌳linktree]: https://linktr.ee/galtzo
397
+ [💖🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=flat&logo=linktree
398
+ [💖💁🏼‍♂️devto]: https://dev.to/galtzo
399
+ [💖💁🏼‍♂️devto-img]: https://img.shields.io/badge/dev.to-0A0A0A?style=flat&logo=devdotto&logoColor=white
400
+ [💖💁🏼‍♂️aboutme]: https://about.me/peter.boling
401
+ [💖💁🏼‍♂️aboutme-img]: https://img.shields.io/badge/about.me-0A0A0A?style=flat&logo=aboutme&logoColor=white
402
+ [💖🧊berg]: https://codeberg.org/pboling
403
+ [💖🐙hub]: https://github.org/pboling
404
+ [💖🛖hut]: https://sr.ht/~galtzo/
405
+ [💖🧪lab]: https://gitlab.com/pboling
406
+ [👨🏼‍🏫expsup-upwork]: https://www.upwork.com/freelancers/~014942e9b056abdf86?mp_source=share
407
+ [👨🏼‍🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
408
+ [👨🏼‍🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
409
+ [👨🏼‍🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-Get_Help-1abc9c?style=for-the-badge&logo=CodeMentor&logoColor=white
410
+ [🏙️entsup-tidelift]: https://tidelift.com/subscription
411
+ [🏙️entsup-tidelift-img]: https://img.shields.io/badge/Tidelift_and_Sonar-Enterprise_Support-FD3456?style=for-the-badge&logo=sonar&logoColor=white
412
+ [🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
413
+ [💁🏼‍♂️peterboling]: http://www.peterboling.com
414
+ [🚂railsbling]: http://www.railsbling.com
415
+ [📜src-gl-img]: https://img.shields.io/badge/GitLab-FBA326?style=for-the-badge&logo=Gitlab&logoColor=orange
416
+ [📜src-gl]: https://gitlab.com/pboling/rspec-stubbed_env/
417
+ [📜src-cb-img]: https://img.shields.io/badge/CodeBerg-4893CC?style=for-the-badge&logo=CodeBerg&logoColor=blue
418
+ [📜src-cb]: https://codeberg.org/pboling/rspec-stubbed_env
419
+ [📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
420
+ [📜src-gh]: https://github.com/pboling/rspec-stubbed_env
421
+ [📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
422
+ [📜docs-head-rd-img]: https://img.shields.io/badge/RubyDoc-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
423
+ [📜wiki]: https://gitlab.com/pboling/rspec-stubbed_env/-/wikis/home
424
+ [📜wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=Wiki&logoColor=white
425
+ [👽dl-rank]: https://rubygems.org/gems/rspec-stubbed_env
426
+ [👽dl-ranki]: https://img.shields.io/gem/rd/rspec-stubbed_env.svg
427
+ [👽oss-help]: https://www.codetriage.com/pboling/rspec-stubbed_env
428
+ [👽oss-helpi]: https://www.codetriage.com/pboling/rspec-stubbed_env/badges/users.svg
429
+ [👽version]: https://rubygems.org/gems/rspec-stubbed_env
430
+ [👽versioni]: https://img.shields.io/gem/v/rspec-stubbed_env.svg
431
+ [🔑cc-mnt]: https://qlty.sh/gh/pboling/projects/rspec-stubbed_env
432
+ [🔑cc-mnti♻️]: https://qlty.sh/badges/3884b648-a5a9-4458-9671-a2ce38a1d470/maintainability.svg
433
+ [🔑cc-cov]: https://qlty.sh/gh/pboling/projects/rspec-stubbed_env
434
+ [🔑cc-covi♻️]: https://qlty.sh/badges/3884b648-a5a9-4458-9671-a2ce38a1d470/test_coverage.svg
435
+ [🔑codecov]: https://codecov.io/gh/pboling/rspec-stubbed_env
436
+ [🔑codecovi♻️]: https://codecov.io/gh/pboling/rspec-stubbed_env/branch/master/graph/badge.svg?token=Ad3ets1psE
437
+ [🔑coveralls]: https://coveralls.io/github/pboling/rspec-stubbed_env?branch=master
438
+ [🔑coveralls-img]: https://coveralls.io/repos/github/pboling/rspec-stubbed_env/badge.svg?branch=master
439
+ [🔑depfu]: https://depfu.com/github/pboling/rspec-stubbed_env?project_id=5884
440
+ [🔑depfui♻️]: https://badges.depfu.com/badges/a48948dd503f23a440f2c17910563f43/count.svg
441
+ [🖐codeQL]: https://github.com/pboling/rspec-stubbed_env/security/code-scanning
442
+ [🖐codeQL-img]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/codeql-analysis.yml/badge.svg
443
+ [🚎1-an-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/ancient.yml
444
+ [🚎1-an-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/ancient.yml/badge.svg
445
+ [🚎2-cov-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/coverage.yml
446
+ [🚎2-cov-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/coverage.yml/badge.svg
447
+ [🚎3-hd-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/heads.yml
448
+ [🚎3-hd-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/heads.yml/badge.svg
449
+ [🚎4-lg-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/legacy.yml
450
+ [🚎4-lg-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/legacy.yml/badge.svg
451
+ [🚎5-st-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/style.yml
452
+ [🚎5-st-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/style.yml/badge.svg
453
+ [🚎6-s-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/supported.yml
454
+ [🚎6-s-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/supported.yml/badge.svg
455
+ [🚎7-us-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/unsupported.yml
456
+ [🚎7-us-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/unsupported.yml/badge.svg
457
+ [🚎8-ho-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/hoary.yml
458
+ [🚎8-ho-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/hoary.yml/badge.svg
459
+ [🚎9-t-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/truffle.yml
460
+ [🚎9-t-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/truffle.yml/badge.svg
461
+ [🚎10-j-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/jruby.yml
462
+ [🚎10-j-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/jruby.yml/badge.svg
463
+ [🚎11-c-wf]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/current.yml
464
+ [🚎11-c-wfi]: https://github.com/pboling/rspec-stubbed_env/actions/workflows/current.yml/badge.svg
465
+ [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay
466
+ [⛳liberapay]: https://liberapay.com/pboling/donate
467
+ [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
468
+ [🖇sponsor]: https://github.com/sponsors/pboling
469
+ [🖇polar-img]: https://img.shields.io/badge/polar-donate-yellow.svg
470
+ [🖇polar]: https://polar.sh/pboling
471
+ [🖇kofi-img]: https://img.shields.io/badge/a_more_different_coffee-✓-yellow.svg
472
+ [🖇kofi]: https://ko-fi.com/O5O86SNP4
473
+ [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
474
+ [🖇patreon]: https://patreon.com/galtzo
475
+ [🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
476
+ [🖇buyme]: https://www.buymeacoffee.com/pboling
477
+ [🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-✓-yellow.svg?style=flat
478
+ [💎ruby-2.3i]: https://img.shields.io/badge/Ruby-2.3-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
479
+ [💎ruby-2.4i]: https://img.shields.io/badge/Ruby-2.4-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
480
+ [💎ruby-2.5i]: https://img.shields.io/badge/Ruby-2.5-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
481
+ [💎ruby-2.6i]: https://img.shields.io/badge/Ruby-2.6-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
482
+ [💎ruby-2.7i]: https://img.shields.io/badge/Ruby-2.7-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
483
+ [💎ruby-3.0i]: https://img.shields.io/badge/Ruby-3.0-CC342D?style=for-the-badge&logo=ruby&logoColor=white
484
+ [💎ruby-3.1i]: https://img.shields.io/badge/Ruby-3.1-CC342D?style=for-the-badge&logo=ruby&logoColor=white
485
+ [💎ruby-3.2i]: https://img.shields.io/badge/Ruby-3.2-CC342D?style=for-the-badge&logo=ruby&logoColor=white
486
+ [💎ruby-3.3i]: https://img.shields.io/badge/Ruby-3.3-CC342D?style=for-the-badge&logo=ruby&logoColor=white
487
+ [💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
488
+ [💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
489
+ [💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
490
+ [💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
491
+ [💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
492
+ [💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
493
+ [💎truby-headi]: https://img.shields.io/badge/Truffle_Ruby-HEAD-34BCB1?style=for-the-badge&logo=ruby&logoColor=blue
494
+ [💎jruby-9.1i]: https://img.shields.io/badge/JRuby-9.1-FBE742?style=for-the-badge&logo=ruby&logoColor=red
495
+ [💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
496
+ [💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
497
+ [💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
498
+ [💎jruby-c-i]: https://img.shields.io/badge/JRuby-current-FBE742?style=for-the-badge&logo=ruby&logoColor=green
499
+ [💎jruby-headi]: https://img.shields.io/badge/JRuby-HEAD-FBE742?style=for-the-badge&logo=ruby&logoColor=blue
500
+ [🤝issues]: https://github.com/pboling/rspec-stubbed_env/issues
501
+ [🤝pulls]: https://github.com/pboling/rspec-stubbed_env/pulls
502
+ [🤝contributing]: CONTRIBUTING.md
503
+ [🔑codecov-g♻️]: https://codecov.io/gh/pboling/rspec-stubbed_env/graphs/tree.svg?token=Ad3ets1psE
504
+ [🖐contrib-rocks]: https://contrib.rocks
505
+ [🖐contributors]: https://github.com/pboling/rspec-stubbed_env/graphs/contributors
506
+ [🖐contributors-img]: https://contrib.rocks/image?repo=pboling/rspec-stubbed_env
507
+ [🚎contributors-gl]: https://gitlab.com/pboling/rspec-stubbed_env/-/graphs/master
508
+ [🪇conduct]: CODE_OF_CONDUCT.md
509
+ [🪇conduct-img]: https://img.shields.io/badge/Contributor_Covenant-2.1-4baaaa.svg
510
+ [📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
511
+ [📌semver]: https://semver.org/spec/v2.0.0.html
512
+ [📌semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
513
+ [📌semver-breaking]: https://github.com/semver/semver/issues/716#issuecomment-869336139
514
+ [📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
515
+ [📌changelog]: CHANGELOG.md
516
+ [📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
517
+ [📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
518
+ [📌gitmoji]:https://gitmoji.dev
519
+ [📌gitmoji-img]:https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square
520
+ [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
521
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.073-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
522
+ [🔐security]: SECURITY.md
523
+ [🔐security-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
524
+ [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
525
+ [📄license]: LICENSE.txt
526
+ [📄license-ref]: https://opensource.org/licenses/MIT
527
+ [📄license-img]: https://img.shields.io/badge/License-MIT-green.svg
528
+ [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
529
+ [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-brightgreen.svg?style=flat
530
+ [🚎yard-current]: http://rubydoc.info/gems/rspec-stubbed_env
531
+ [🚎yard-head]: https://rubydoc.info/github/pboling/rspec-stubbed_env/master
532
+ [💎stone_checksums]: https://github.com/pboling/stone_checksums
533
+ [💎SHA_checksums]: https://gitlab.com/pboling/rspec-stubbed_env/-/tree/main/checksums
data/SECURITY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ |----------|-----------|
7
+ | 1.latest | ✅ |
8
+
9
+ ## Security contact information
10
+
11
+ To report a security vulnerability, please use the
12
+ [Tidelift security contact](https://tidelift.com/security).
13
+ Tidelift will coordinate the fix and disclosure.
14
+
15
+ ## Additional Support
16
+
17
+ If you are interested in support for versions older than the latest release,
18
+ please consider sponsoring the project / maintainer @ https://liberapay.com/pboling/donate,
19
+ or find other sponsorship links in the [README].
20
+
21
+ [README]: README.md