rspec-stubbed_env 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.pryrc +13 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +32 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE +7 -0
- data/README.md +135 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/rspec/stubbed_env.rb +29 -0
- data/lib/rspec/stubbed_env/config.rb +21 -0
- data/lib/rspec/stubbed_env/test_helpers.rb +63 -0
- data/lib/rspec/stubbed_env/version.rb +7 -0
- data/rspec-stubbed_env.gemspec +36 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0f5215e742c22f09ea48531c86d14314678ccc73d84aa3d854567fe657aaa162
|
4
|
+
data.tar.gz: 6e060354684b694b98e0f8b5caffdb751044941f9f5f0d03d59903e1c0254623
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f0ca35e533aa20855454f485f4623b34904c5287a8c04a5075942e82774ab35bc091fd2190970ba33678ddbd01441f015a0fa7f62879ca11dfdb4c60a33533c0
|
7
|
+
data.tar.gz: f37af4f2c0e48b87b226e90934f3f1421864f3ed3a48eae46669c9da1e0e33e37d36ae839495bfe082cf42750acebd1713407c8ad1605974338f3d203cec9d50
|
data/.gitignore
ADDED
data/.pryrc
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if defined?(PryByebug)
|
4
|
+
Pry.commands.alias_command 'c', 'continue'
|
5
|
+
Pry.commands.alias_command 's', 'step'
|
6
|
+
Pry.commands.alias_command 'n', 'next'
|
7
|
+
Pry.commands.alias_command 'trace', 'backtrace'
|
8
|
+
end
|
9
|
+
|
10
|
+
# Hit Enter to repeat last command
|
11
|
+
Pry::Commands.command /^$/, 'repeat last command' do
|
12
|
+
_pry_.run_command Pry.history.to_a.last
|
13
|
+
end
|
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.5.1
|
data/.travis.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- JRUBY_OPTS="-Xcli.debug=true --debug"
|
5
|
+
- CC_TEST_REPORTER_ID=3ed1c79841ccc5d053b995c63c0ead562427a77dba728601b8d19f02b16ac0f2
|
6
|
+
|
7
|
+
before_script:
|
8
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
9
|
+
- chmod +x ./cc-test-reporter
|
10
|
+
- ./cc-test-reporter before-build
|
11
|
+
|
12
|
+
script:
|
13
|
+
- bundle exec rake
|
14
|
+
|
15
|
+
after_script:
|
16
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
17
|
+
|
18
|
+
before_install:
|
19
|
+
- gem update --system
|
20
|
+
- gem install bundler -v 1.16.5
|
21
|
+
|
22
|
+
install:
|
23
|
+
- bundle install
|
24
|
+
|
25
|
+
bundler_args: --no-deployment --jobs 3 --retry 3
|
26
|
+
|
27
|
+
language: ruby
|
28
|
+
cache: bundler
|
29
|
+
rvm:
|
30
|
+
- 2.3.7
|
31
|
+
- 2.4.4
|
32
|
+
- 2.5.1
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at peter.boling@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright 2018 Peter Boling of railsbling.com
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
# RSpec::StubbedEnv
|
2
|
+
|
3
|
+
ENV stubbing via a shared context for more powerful tests.
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
describe 'my stubbed test' do
|
7
|
+
include_context 'with stubbed env'
|
8
|
+
before do
|
9
|
+
stub_env('FOO' => 'is bar')
|
10
|
+
end
|
11
|
+
it 'has a value' do
|
12
|
+
expect(ENV['FOO']).to eq('is bar')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
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) |
|
31
|
+
|
32
|
+
|
33
|
+
## Installation
|
34
|
+
|
35
|
+
Add this line to your application's Gemfile:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
gem 'rspec-stubbed_env', group: :test
|
39
|
+
```
|
40
|
+
|
41
|
+
And then execute:
|
42
|
+
|
43
|
+
$ bundle
|
44
|
+
|
45
|
+
Or install it yourself as:
|
46
|
+
|
47
|
+
$ gem install rspec-stubbed_env
|
48
|
+
|
49
|
+
|
50
|
+
You must configure RSpec to use the `:expect` syntax, or some compatible alternative.
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
RSpec.configure do |config|
|
54
|
+
config.expect_with :rspec do |c|
|
55
|
+
c.syntax = :expect
|
56
|
+
end
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
## Usage
|
61
|
+
|
62
|
+
ENV stubbing:
|
63
|
+
|
64
|
+
- is opt-in, via a shared context, rather than global.
|
65
|
+
- *does not* affect the real ENV at all. It is a true stub.
|
66
|
+
- has the same scope as a `before`, `subject`, or `let` at the same level.
|
67
|
+
|
68
|
+
See the spec suite for detailed examples.
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
# 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
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# With a stubbed ENV!
|
79
|
+
describe 'my stubbed test' do
|
80
|
+
include_context 'with stubbed env'
|
81
|
+
before do
|
82
|
+
stub_env('FOO' => 'is bar')
|
83
|
+
end
|
84
|
+
it 'has a value' do
|
85
|
+
expect(ENV['FOO']).to eq('is bar')
|
86
|
+
end
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
90
|
+
## Development
|
91
|
+
|
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.
|
93
|
+
|
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).
|
95
|
+
|
96
|
+
## Contributing
|
97
|
+
|
98
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/rspec-stubbed_env.
|
99
|
+
|
100
|
+
## Code of Conduct
|
101
|
+
|
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).
|
103
|
+
|
104
|
+
## Versioning
|
105
|
+
|
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.
|
112
|
+
|
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.
|
115
|
+
|
116
|
+
For example:
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
spec.add_dependency 'rspec-stubbed_env', '~> 1.0'
|
120
|
+
```
|
121
|
+
|
122
|
+
## License
|
123
|
+
|
124
|
+
* Copyright (c) 2018 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
125
|
+
|
126
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
|
127
|
+
|
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/
|
data/Rakefile
ADDED
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 'rspec/stubbed_env'
|
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,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rspec/stubbed_env/version'
|
4
|
+
|
5
|
+
# External Gems
|
6
|
+
require 'rspec'
|
7
|
+
|
8
|
+
# This Gem
|
9
|
+
require 'rspec/stubbed_env/test_helpers'
|
10
|
+
require 'rspec/stubbed_env/config'
|
11
|
+
|
12
|
+
#
|
13
|
+
# ENV stubbing is opt-in, via a shared context, rather than global
|
14
|
+
#
|
15
|
+
# describe 'my stubbed test' do
|
16
|
+
# include_context 'with stubbed env'
|
17
|
+
# before do
|
18
|
+
# stub_env('FOO' => 'is bar')
|
19
|
+
# end
|
20
|
+
# it 'does a thing' do
|
21
|
+
# expect(ENV['FOO']).to eq('is bar')
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
module RSpec
|
26
|
+
# Gem Namespace
|
27
|
+
module StubbedEnv
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# ENV stubbing is opt-in, via a shared context, rather than global
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
#
|
8
|
+
# describe 'my stubbed test' do
|
9
|
+
# include_context 'with stubbed env'
|
10
|
+
# before do
|
11
|
+
# stub_env('FOO' => 'is bar')
|
12
|
+
# end
|
13
|
+
# it 'does a thing' do
|
14
|
+
# expect(ENV['FOO']).to eq('is bar')
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
|
19
|
+
RSpec.shared_context 'with stubbed env' do
|
20
|
+
include RSpec::StubbedEnv::TestHelpers
|
21
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# ENV stubbing is opt-in, via a shared context, rather than global
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
#
|
8
|
+
# describe 'my stubbed test' do
|
9
|
+
# include_context 'with stubbed env'
|
10
|
+
# before do
|
11
|
+
# stub_env('FOO' => 'is bar')
|
12
|
+
# end
|
13
|
+
# it 'does a thing' do
|
14
|
+
# expect(ENV['FOO']).to eq('is bar')
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
module RSpec
|
19
|
+
module StubbedEnv
|
20
|
+
# Helpers to unobtrusively stub ENV
|
21
|
+
module TestHelpers
|
22
|
+
# Can be called with all key value pairs to be stubbed as a hash:
|
23
|
+
#
|
24
|
+
# stub_env('A' => 'B', 'C' => 'D', 'E' => 'F')
|
25
|
+
#
|
26
|
+
# Alternatively can be called one per ENV key-value pair to stub:
|
27
|
+
#
|
28
|
+
# stub_env('A', 'B')
|
29
|
+
# stub_env('C', 'D')
|
30
|
+
# stub_env('E', 'F')
|
31
|
+
def stub_env(key_or_hash, value = nil)
|
32
|
+
init_stub unless env_stubbed?
|
33
|
+
if key_or_hash.is_a? Hash
|
34
|
+
key_or_hash.each { |k, v| add_stubbed_value(k, v) }
|
35
|
+
else
|
36
|
+
add_stubbed_value key_or_hash, value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
STUBBED_KEY = '__STUBBED__'
|
43
|
+
|
44
|
+
def add_stubbed_value(key, value)
|
45
|
+
allow(ENV).to receive(:[]).with(key).and_return(value)
|
46
|
+
allow(ENV).to receive(:fetch).with(key).and_return(value)
|
47
|
+
allow(ENV).to receive(:fetch).with(key, anything) do |_, default_val|
|
48
|
+
value || default_val
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def env_stubbed?
|
53
|
+
ENV[STUBBED_KEY]
|
54
|
+
end
|
55
|
+
|
56
|
+
def init_stub
|
57
|
+
allow(ENV).to receive(:[]).and_call_original
|
58
|
+
allow(ENV).to receive(:fetch).and_call_original
|
59
|
+
add_stubbed_value(STUBBED_KEY, true)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'rspec/stubbed_env/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'rspec-stubbed_env'
|
9
|
+
spec.version = RSpec::StubbedEnv::VERSION
|
10
|
+
spec.authors = ['Peter Boling']
|
11
|
+
spec.email = ['peter.boling@gmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'Unobtrusively stub ENV keys and values during testing'
|
14
|
+
spec.description = %[Stub environment variables in a scoped context for testing
|
15
|
+
stub_env(
|
16
|
+
'AWS_REGION' => 'us-east-1',
|
17
|
+
'REDIS_URL' => 'redis://localhost:6379/'
|
18
|
+
)]
|
19
|
+
spec.homepage = 'https://github.com/pboling/rspec-stubbed_env'
|
20
|
+
spec.license = 'MIT'
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_runtime_dependency 'rspec', '>= 3.0'
|
32
|
+
|
33
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
34
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
35
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-stubbed_env
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Boling
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.16'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.16'
|
69
|
+
description: |-
|
70
|
+
Stub environment variables in a scoped context for testing
|
71
|
+
stub_env(
|
72
|
+
'AWS_REGION' => 'us-east-1',
|
73
|
+
'REDIS_URL' => 'redis://localhost:6379/'
|
74
|
+
)
|
75
|
+
email:
|
76
|
+
- peter.boling@gmail.com
|
77
|
+
executables: []
|
78
|
+
extensions: []
|
79
|
+
extra_rdoc_files: []
|
80
|
+
files:
|
81
|
+
- ".gitignore"
|
82
|
+
- ".pryrc"
|
83
|
+
- ".rspec"
|
84
|
+
- ".ruby-version"
|
85
|
+
- ".travis.yml"
|
86
|
+
- CODE_OF_CONDUCT.md
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- bin/console
|
92
|
+
- bin/setup
|
93
|
+
- lib/rspec/stubbed_env.rb
|
94
|
+
- lib/rspec/stubbed_env/config.rb
|
95
|
+
- lib/rspec/stubbed_env/test_helpers.rb
|
96
|
+
- lib/rspec/stubbed_env/version.rb
|
97
|
+
- rspec-stubbed_env.gemspec
|
98
|
+
homepage: https://github.com/pboling/rspec-stubbed_env
|
99
|
+
licenses:
|
100
|
+
- MIT
|
101
|
+
metadata: {}
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 2.7.7
|
119
|
+
signing_key:
|
120
|
+
specification_version: 4
|
121
|
+
summary: Unobtrusively stub ENV keys and values during testing
|
122
|
+
test_files: []
|