dependor 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/dependor.rb +2 -0
- data/lib/dependor/isolate.rb +7 -0
- data/lib/dependor/rspec.rb +3 -0
- data/lib/dependor/sending_injector.rb +9 -0
- data/lib/dependor/version.rb +1 -1
- data/spec/dependor/isolate_spec.rb +30 -0
- data/spec/spec_helper.rb +1 -0
- metadata +8 -4
data/Gemfile.lock
CHANGED
data/lib/dependor.rb
CHANGED
@@ -7,7 +7,9 @@ module Dependor
|
|
7
7
|
autoload :CustomizedInjector, 'dependor/customized_injector'
|
8
8
|
autoload :Injectable, 'dependor/injectable'
|
9
9
|
autoload :Instantiator, 'dependor/instantiator'
|
10
|
+
autoload :Isolate, 'dependor/isolate'
|
10
11
|
autoload :Let, 'dependor/let'
|
12
|
+
autoload :SendingInjector, 'dependor/sending_injector'
|
11
13
|
autoload :Shorty, 'dependor/shorty'
|
12
14
|
autoload :UnknownObject, 'dependor/exceptions'
|
13
15
|
autoload :VERSION, 'dependor/version'
|
data/lib/dependor/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Dependor::Isolate do
|
4
|
+
class ExampleSubject
|
5
|
+
takes :foo, :bar
|
6
|
+
end
|
7
|
+
|
8
|
+
class ExampleContext
|
9
|
+
include Dependor::Isolate
|
10
|
+
|
11
|
+
def subject
|
12
|
+
isolate(ExampleSubject)
|
13
|
+
end
|
14
|
+
|
15
|
+
def foo
|
16
|
+
"the foo stub"
|
17
|
+
end
|
18
|
+
|
19
|
+
def bar
|
20
|
+
"the bar stub"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "injects the subject's dependencies using methods on context" do
|
25
|
+
context = ExampleContext.new
|
26
|
+
|
27
|
+
context.subject.foo.should == "the foo stub"
|
28
|
+
context.subject.bar.should == "the bar stub"
|
29
|
+
end
|
30
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -135,7 +135,10 @@ files:
|
|
135
135
|
- lib/dependor/exceptions.rb
|
136
136
|
- lib/dependor/injectable.rb
|
137
137
|
- lib/dependor/instantiator.rb
|
138
|
+
- lib/dependor/isolate.rb
|
138
139
|
- lib/dependor/let.rb
|
140
|
+
- lib/dependor/rspec.rb
|
141
|
+
- lib/dependor/sending_injector.rb
|
139
142
|
- lib/dependor/shorty.rb
|
140
143
|
- lib/dependor/version.rb
|
141
144
|
- pelusa.sh
|
@@ -145,6 +148,7 @@ files:
|
|
145
148
|
- spec/dependor/customized_injector_spec.rb
|
146
149
|
- spec/dependor/injectable_spec.rb
|
147
150
|
- spec/dependor/instantiator_spec.rb
|
151
|
+
- spec/dependor/isolate_spec.rb
|
148
152
|
- spec/dependor/let_spec.rb
|
149
153
|
- spec/dependor/shorty_spec.rb
|
150
154
|
- spec/spec_helper.rb
|
@@ -162,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
166
|
version: '0'
|
163
167
|
segments:
|
164
168
|
- 0
|
165
|
-
hash: -
|
169
|
+
hash: -869165773
|
166
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
171
|
none: false
|
168
172
|
requirements:
|
@@ -171,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
175
|
version: '0'
|
172
176
|
segments:
|
173
177
|
- 0
|
174
|
-
hash: -
|
178
|
+
hash: -869165773
|
175
179
|
requirements: []
|
176
180
|
rubyforge_project: dependor
|
177
181
|
rubygems_version: 1.8.24
|