rspec-isolate 0.1.0 → 0.2.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 +5 -5
- data/README.md +4 -4
- data/lib/rspec/isolate.rb +4 -4
- data/lib/rspec/isolate/{throw_on_call.rb → error_on_call.rb} +1 -1
- data/lib/rspec/isolate/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c3b2dafd8befd20237938c2cca2e3e4196d7e76b
|
4
|
+
data.tar.gz: c791c7a3165422991487ca5a914aa4b2fd5b331c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7413302bc2575ca2307cee59f85b5e35c97f1ea23989c66ed057bd982329157e9d549bda5c5e5c902b06f8c908556dae66235801b91a6fd6fe1b93a6e934c010
|
7
|
+
data.tar.gz: eb95966bbc62298ca182f8b94467e92ea400a68b2bc1af6e6b4be615669be023ad411e04e5c3bb3a86230a107e068440579ab7c9c90e79ef7be6c9d43587ce7b
|
data/README.md
CHANGED
@@ -32,13 +32,13 @@ require 'rspec/isolate'
|
|
32
32
|
Add a tag to your describe block as below.
|
33
33
|
|
34
34
|
```ruby
|
35
|
-
RSpec.describe ClassUnderTest,
|
35
|
+
RSpec.describe ClassUnderTest, error_on_call: [ CollaboratorClassOne, CollaboratorClassTwo ] do
|
36
36
|
# Calling any method on `CollaboratorClassOne` and `CollaboratorClassTwo` in
|
37
|
-
# the course of this test suite will
|
37
|
+
# the course of this test suite will raise an error.
|
38
38
|
end
|
39
39
|
```
|
40
40
|
|
41
|
-
Or, if you prefer warnings to errors
|
41
|
+
Or, if you prefer warnings to errors.
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
RSpec.describe ClassUnderTest, warn_on_call: [ CollaboratorClassOne, CollaboratorClassTwo ] do
|
@@ -80,7 +80,7 @@ end
|
|
80
80
|
|
81
81
|
# spec/statement_formatter.rb
|
82
82
|
|
83
|
-
RSpec.describe StatementFormatter,
|
83
|
+
RSpec.describe StatementFormatter, error_on_call: [ TransactionFormatter ] do
|
84
84
|
describe "#format" do
|
85
85
|
|
86
86
|
# This will fail, as `StatementFormatter` will call `TransactionFormatter`
|
data/lib/rspec/isolate.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require "rspec/isolate/version"
|
2
|
-
require "rspec/isolate/
|
2
|
+
require "rspec/isolate/error_on_call"
|
3
3
|
require "rspec/isolate/warn_on_call"
|
4
4
|
require "rspec/isolate/constant_replacer"
|
5
5
|
require "rspec/core"
|
6
6
|
|
7
7
|
RSpec.configure do |config|
|
8
|
-
config.around :example, :
|
9
|
-
klass_constants = example.metadata[:
|
10
|
-
ConstantReplacer.replace(klass_constants, &
|
8
|
+
config.around :example, :error_on_call do |example|
|
9
|
+
klass_constants = example.metadata[:error_on_call]
|
10
|
+
ConstantReplacer.replace(klass_constants, &ErrorOnCall.method(:new))
|
11
11
|
example.run
|
12
12
|
ConstantReplacer.replace(klass_constants, &:itself)
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-isolate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kay Lack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
- bin/setup
|
71
71
|
- lib/rspec/isolate.rb
|
72
72
|
- lib/rspec/isolate/constant_replacer.rb
|
73
|
-
- lib/rspec/isolate/
|
73
|
+
- lib/rspec/isolate/error_on_call.rb
|
74
74
|
- lib/rspec/isolate/version.rb
|
75
75
|
- lib/rspec/isolate/warn_on_call.rb
|
76
76
|
- rspec-isolate.gemspec
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.6.8
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Enforce isolation in your unit tests.
|