payload 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -10
- data/lib/payload/testing.rb +1 -1
- data/lib/payload/version.rb +1 -1
- data/payload.gemspec +1 -1
- data/spec/payload/definition_spec.rb +4 -4
- data/spec/payload/factory_resolver_spec.rb +2 -2
- data/spec/payload/service_resolver_spec.rb +2 -2
- data/spec/payload/undefined_definition_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fa079c6398f542f86d57e0d7877adfd70566478
|
4
|
+
data.tar.gz: e2ac201ce98bd76fcc49bc8356d326a4a72e16db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d7f4b24a8cfa7aa9b81dfdce4e1c428727352ecffd8c21010c980723022cbe6b94519d5525082a45903556fc8241c1a032cb5c57eee4fa5f37e81c13ea31f4
|
7
|
+
data.tar.gz: bc383b6d05c0bc47a49c1cc56159437db0a1937484fbfb724d75557316bf8b996707a2ef0f8475d36e15b7038a80ccc3d4e9a507a59182e569bb4acab9611263
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
payload (0.2.
|
4
|
+
payload (0.2.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,14 +9,18 @@ GEM
|
|
9
9
|
diff-lcs (1.2.5)
|
10
10
|
rack (1.5.2)
|
11
11
|
rake (10.3.2)
|
12
|
-
rspec (
|
13
|
-
rspec-core (~>
|
14
|
-
rspec-expectations (~>
|
15
|
-
rspec-mocks (~>
|
16
|
-
rspec-core (
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
rspec (3.1.0)
|
13
|
+
rspec-core (~> 3.1.0)
|
14
|
+
rspec-expectations (~> 3.1.0)
|
15
|
+
rspec-mocks (~> 3.1.0)
|
16
|
+
rspec-core (3.1.7)
|
17
|
+
rspec-support (~> 3.1.0)
|
18
|
+
rspec-expectations (3.1.2)
|
19
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
20
|
+
rspec-support (~> 3.1.0)
|
21
|
+
rspec-mocks (3.1.3)
|
22
|
+
rspec-support (~> 3.1.0)
|
23
|
+
rspec-support (3.1.2)
|
20
24
|
|
21
25
|
PLATFORMS
|
22
26
|
ruby
|
@@ -25,4 +29,4 @@ DEPENDENCIES
|
|
25
29
|
payload!
|
26
30
|
rack
|
27
31
|
rake
|
28
|
-
rspec (~>
|
32
|
+
rspec (~> 3.1.0)
|
data/lib/payload/testing.rb
CHANGED
@@ -26,7 +26,7 @@ module Payload
|
|
26
26
|
def stub_factory_instance(dependency, attributes)
|
27
27
|
factory = stub_factory(dependency)
|
28
28
|
double(dependency.to_s).tap do |double|
|
29
|
-
factory.
|
29
|
+
allow(factory).to receive(:new).with(attributes).and_return(double)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/payload/version.rb
CHANGED
data/payload.gemspec
CHANGED
@@ -8,7 +8,7 @@ describe Payload::Definition do
|
|
8
8
|
resolver = double('resolver')
|
9
9
|
container = double('container')
|
10
10
|
decorators = double('decorators')
|
11
|
-
resolver.
|
11
|
+
allow(resolver).to receive(:resolve).and_return(resolved)
|
12
12
|
definition = Payload::Definition.new(:example, resolver, decorators)
|
13
13
|
|
14
14
|
result = definition.resolve(container)
|
@@ -22,12 +22,12 @@ describe Payload::Definition do
|
|
22
22
|
it 'returns a new decorated service' do
|
23
23
|
decorator = double('first_decorator')
|
24
24
|
resolver = double('resolver')
|
25
|
-
resolver.
|
25
|
+
allow(resolver).to receive(:resolve)
|
26
26
|
container = double('container')
|
27
27
|
decorated = double('decorated')
|
28
28
|
decorators = double('decorators')
|
29
|
-
decorators.
|
30
|
-
Payload::DecoratorChain.
|
29
|
+
allow(decorators).to receive(:add).and_return(decorated)
|
30
|
+
allow(Payload::DecoratorChain).to receive(:new).and_return(decorators)
|
31
31
|
definition = Payload::Definition.new(:name, resolver)
|
32
32
|
|
33
33
|
definition.
|
@@ -9,8 +9,8 @@ describe Payload::FactoryResolver do
|
|
9
9
|
container = double('container')
|
10
10
|
decorators = double('decorators')
|
11
11
|
definition = Payload::FactoryResolver.new(block)
|
12
|
-
Payload::Factory.
|
13
|
-
|
12
|
+
allow(Payload::Factory).
|
13
|
+
to receive(:new).
|
14
14
|
with(container, block, decorators).
|
15
15
|
and_return(factory)
|
16
16
|
|
@@ -8,8 +8,8 @@ describe Payload::ServiceResolver do
|
|
8
8
|
container = { dependency: dependency }
|
9
9
|
decorated = double('decorated')
|
10
10
|
decorators = double('decorators')
|
11
|
-
decorators.
|
12
|
-
|
11
|
+
allow(decorators).
|
12
|
+
to receive(:decorate).
|
13
13
|
with(dependency, container).
|
14
14
|
and_return(decorated)
|
15
15
|
block = lambda { |yielded| yielded[:dependency] }
|
@@ -39,7 +39,7 @@ describe Payload::UndefinedDefinition do
|
|
39
39
|
first = double('decorator_one')
|
40
40
|
second = double('decorator_two')
|
41
41
|
replacement = double('replacement')
|
42
|
-
replacement.
|
42
|
+
allow(replacement).to receive(:decorate).and_return(replacement)
|
43
43
|
definition = Payload::UndefinedDefinition.new(:name)
|
44
44
|
|
45
45
|
defined = definition.
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 3.1.0
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 3.1.0
|
56
56
|
description: Dependency configuration and injection for Ruby and Rails.
|
57
57
|
email: support@thoughtbot.com
|
58
58
|
executables: []
|