rspec_multi_env 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -9
- data/lib/rspec_multi_env/environment_configuration.rb +8 -0
- data/lib/rspec_multi_env/hooks.rb +3 -11
- data/lib/rspec_multi_env/version.rb +1 -1
- data/lib/rspec_multi_env.rb +3 -1
- metadata +1 -2
- data/lib/rspec_multi_env/dsl.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2477a605777ba09423cd216acdb09f2a8c5e08d
|
4
|
+
data.tar.gz: d232c4e70beb399d3513584c7fc0689db89566c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d4baf8c8103c49f1f7e20c1596e12100ccd857948f2b3450952e47f00735823b550dcc1e53533c6af9d34f1632eeb60215a88cdace91a0df974ef056fdad046
|
7
|
+
data.tar.gz: b54c85b5f3b9638285c810fa125b2bebe9042ed6e75932b4b940e02444be730e83dd1f4b945090b23a395b1bd3a36f1321a0e9464ad8c9bac88a30f1d6fa7ac7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,17 +24,17 @@ Or install it yourself as:
|
|
24
24
|
## Usage
|
25
25
|
|
26
26
|
```ruby
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#... custom code/configuration
|
31
|
-
end
|
32
|
-
|
33
|
-
environment :staging do
|
34
|
-
#... custom code/configuration
|
35
|
-
end
|
27
|
+
RspecMultiEnv.setup do |env|
|
28
|
+
env.when :sandboxed do
|
29
|
+
#... custom code/configuration
|
36
30
|
end
|
37
31
|
|
32
|
+
env.when :staging do
|
33
|
+
#... custom code/configuration
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe 'Your Test' do
|
38
38
|
# rest of your tests that use the env specific config
|
39
39
|
end
|
40
40
|
```
|
@@ -1,15 +1,7 @@
|
|
1
1
|
RSpec.configure do |config|
|
2
|
-
config.
|
3
|
-
|
4
|
-
|
5
|
-
RspecMultiEnv::EnvironmentConfiguration.instance.reset
|
6
|
-
end
|
7
|
-
|
8
|
-
config.around(:example) do |example|
|
9
|
-
if RspecMultiEnv::EnvironmentConfiguration.instance.current_environment_registered?
|
10
|
-
example.run
|
11
|
-
else
|
12
|
-
example.skip
|
2
|
+
config.before :context do |context|
|
3
|
+
unless RspecMultiEnv::EnvironmentConfiguration.instance.current_environment_registered?
|
4
|
+
context.skip
|
13
5
|
end
|
14
6
|
end
|
15
7
|
end
|
data/lib/rspec_multi_env.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "rspec_multi_env/version"
|
2
2
|
require "rspec_multi_env/environment_configuration"
|
3
|
-
require "rspec_multi_env/dsl"
|
4
3
|
require "rspec_multi_env/hooks"
|
5
4
|
|
6
5
|
module RspecMultiEnv
|
6
|
+
def self.setup(&block)
|
7
|
+
yield RspecMultiEnv::EnvironmentConfiguration.instance.reset
|
8
|
+
end
|
7
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_multi_env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- smsohan
|
@@ -56,7 +56,6 @@ files:
|
|
56
56
|
- bin/console
|
57
57
|
- bin/setup
|
58
58
|
- lib/rspec_multi_env.rb
|
59
|
-
- lib/rspec_multi_env/dsl.rb
|
60
59
|
- lib/rspec_multi_env/environment_configuration.rb
|
61
60
|
- lib/rspec_multi_env/hooks.rb
|
62
61
|
- lib/rspec_multi_env/version.rb
|