little_boxes 0.1.0 → 0.3.7
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 +4 -4
- data/.gitignore +2 -0
- data/Gemfile +1 -0
- data/README.md +187 -2
- data/Rakefile +4 -0
- data/lib/little_boxes.rb +10 -4
- data/lib/little_boxes/box.rb +111 -10
- data/lib/little_boxes/configurable.rb +66 -0
- data/lib/little_boxes/entry.rb +30 -0
- data/lib/little_boxes/entry_definition.rb +28 -0
- data/lib/little_boxes/strategy.rb +79 -0
- data/lib/little_boxes/version.rb +1 -1
- data/little_boxes.gemspec +0 -2
- data/spec/benchmarks_spec.rb +162 -0
- data/spec/docs/readme_spec.rb +32 -0
- data/spec/integration/thread_safety_spec.rb +76 -0
- data/spec/little_boxes/box_spec.rb +222 -234
- data/spec/real_benchmarks_spec.rb +164 -0
- data/spec/spec_helper.rb +24 -6
- metadata +17 -41
- data/lib/little_boxes/defined_dependant.rb +0 -9
- data/lib/little_boxes/dependant.rb +0 -44
- data/lib/little_boxes/dependant_registry.rb +0 -44
- data/lib/little_boxes/memoized_dependant.rb +0 -9
- data/lib/little_boxes/null_logger.rb +0 -8
- data/lib/little_boxes/obtained.rb +0 -13
- data/lib/little_boxes/registry.rb +0 -84
- data/spec/little_boxes/dependant_spec.rb +0 -28
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe LittleBoxes::Dependant do
|
4
|
-
let(:box) { LittleBoxes::Box.new }
|
5
|
-
|
6
|
-
describe 'Dependant' do
|
7
|
-
it 'can be inherited' do
|
8
|
-
class_one = Class.new do
|
9
|
-
include LittleBoxes::Dependant
|
10
|
-
dependency :one
|
11
|
-
end
|
12
|
-
|
13
|
-
class_two = Class.new class_one do
|
14
|
-
include LittleBoxes::Dependant
|
15
|
-
dependency :two
|
16
|
-
end
|
17
|
-
|
18
|
-
box.let(:one) { :one }
|
19
|
-
box.let(:two) { :two }
|
20
|
-
box.let(:dependant_one) { class_one.new }
|
21
|
-
box.let(:dependant_two) { class_two.new }
|
22
|
-
|
23
|
-
expect(box.dependant_one.one).to be :one
|
24
|
-
expect(box.dependant_two.one).to be :one
|
25
|
-
expect(box.dependant_two.two).to be :two
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|