scorpion-ioc 0.6.2 → 1.0.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 +4 -4
- data/.rubocop.yml +144 -30
- data/Gemfile +17 -13
- data/README.md +24 -69
- data/Rakefile +12 -0
- data/app/README +1 -0
- data/bin/rspec +2 -1
- data/config.ru +2 -2
- data/config/environment.rb +1 -0
- data/lib/scorpion-ioc.rb +3 -1
- data/lib/scorpion.rb +32 -45
- data/lib/scorpion/attribute.rb +14 -34
- data/lib/scorpion/attribute_set.rb +11 -13
- data/lib/scorpion/chain_hunter.rb +4 -4
- data/lib/scorpion/dependency.rb +22 -58
- data/lib/scorpion/dependency/argument_dependency.rb +4 -4
- data/lib/scorpion/dependency/builder_dependency.rb +5 -5
- data/lib/scorpion/dependency/captured_dependency.rb +4 -6
- data/lib/scorpion/dependency/class_dependency.rb +3 -17
- data/lib/scorpion/dependency/module_dependency.rb +1 -1
- data/lib/scorpion/dependency_map.rb +16 -16
- data/lib/scorpion/error.rb +12 -9
- data/lib/scorpion/hunt.rb +33 -34
- data/lib/scorpion/hunter.rb +6 -6
- data/lib/scorpion/locale/en.yml +2 -2
- data/lib/scorpion/method.rb +11 -1
- data/lib/scorpion/object.rb +16 -31
- data/lib/scorpion/rack.rb +1 -1
- data/lib/scorpion/rack/middleware.rb +2 -1
- data/lib/scorpion/rails.rb +6 -6
- data/lib/scorpion/rails/active_record.rb +4 -4
- data/lib/scorpion/rails/active_record/association.rb +3 -3
- data/lib/scorpion/rails/active_record/relation.rb +3 -2
- data/lib/scorpion/rails/controller.rb +2 -2
- data/lib/scorpion/rails/job.rb +1 -1
- data/lib/scorpion/rails/mailer.rb +1 -1
- data/lib/scorpion/rails/nest.rb +11 -11
- data/lib/scorpion/rails/railtie.rb +2 -2
- data/lib/scorpion/rspec.rb +2 -2
- data/lib/scorpion/rspec/helper.rb +3 -3
- data/lib/scorpion/stinger.rb +19 -18
- data/lib/scorpion/version.rb +3 -3
- data/scorpion.gemspec +13 -13
- data/spec/internal/db/schema.rb +1 -1
- data/spec/lib/scorpion/attribute_set_spec.rb +4 -22
- data/spec/lib/scorpion/attribute_spec.rb +3 -8
- data/spec/lib/scorpion/chain_hunter_spec.rb +1 -1
- data/spec/lib/scorpion/dependency/argument_dependency_spec.rb +3 -7
- data/spec/lib/scorpion/dependency/builder_dependency_spec.rb +7 -7
- data/spec/lib/scorpion/dependency/module_dependency_spec.rb +3 -3
- data/spec/lib/scorpion/dependency_map_spec.rb +4 -25
- data/spec/lib/scorpion/dependency_spec.rb +18 -45
- data/spec/lib/scorpion/error_spec.rb +1 -1
- data/spec/lib/scorpion/hunt_spec.rb +16 -28
- data/spec/lib/scorpion/hunter_spec.rb +29 -21
- data/spec/lib/scorpion/object_spec.rb +20 -19
- data/spec/lib/scorpion/rack/middleware_spec.rb +4 -4
- data/spec/lib/scorpion/rack_spec.rb +1 -1
- data/spec/lib/scorpion/rails/active_record/association_spec.rb +3 -3
- data/spec/lib/scorpion/rails/active_record/model_spec.rb +3 -3
- data/spec/lib/scorpion/rails/active_record/relation_spec.rb +3 -3
- data/spec/lib/scorpion/rails/controller_spec.rb +8 -8
- data/spec/lib/scorpion/rails/job_spec.rb +1 -1
- data/spec/lib/scorpion/rspec/helper_spec.rb +11 -11
- data/spec/lib/scorpion_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -10
- metadata +6 -6
- data/lib/scorpion/object_constructor.rb +0 -79
- data/spec/lib/scorpion/object_constructor_spec.rb +0 -124
@@ -32,14 +32,14 @@ module Scorpion
|
|
32
32
|
|
33
33
|
# from ActiveRecord::Relation
|
34
34
|
[ :new, :build, :create, :create! ].each do |method|
|
35
|
-
class_eval <<-
|
35
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
36
36
|
def #{ method }( *args, &block )
|
37
37
|
super *args do |*block_args|
|
38
38
|
sting!( block_args )
|
39
39
|
yield *block_args if block_given?
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
42
|
+
RUBY
|
43
43
|
end
|
44
44
|
|
45
45
|
# from ActiveRecord::SpawnMethods
|
@@ -48,6 +48,7 @@ module Scorpion
|
|
48
48
|
end
|
49
49
|
|
50
50
|
private
|
51
|
+
|
51
52
|
# from ActiveRecord::Relation
|
52
53
|
def exec_queries( *args, &block )
|
53
54
|
sting!( super )
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "scorpion/nest"
|
2
2
|
|
3
3
|
module Scorpion
|
4
4
|
module Rails
|
@@ -6,7 +6,7 @@ module Scorpion
|
|
6
6
|
# Adds a scorpion nest to support injection into rails controllers.
|
7
7
|
module Controller
|
8
8
|
|
9
|
-
ENV_KEY =
|
9
|
+
ENV_KEY = "scorpion.controller.instance".freeze
|
10
10
|
|
11
11
|
|
12
12
|
# Fetch an object from the controller's {#scorpion}.
|
data/lib/scorpion/rails/job.rb
CHANGED
data/lib/scorpion/rails/nest.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "scorpion/nest"
|
2
|
+
require "active_support/core_ext/class/attribute"
|
3
3
|
|
4
4
|
module Scorpion
|
5
5
|
module Rails
|
@@ -32,8 +32,7 @@ module Scorpion
|
|
32
32
|
#
|
33
33
|
# @!endgroup Attributes
|
34
34
|
|
35
|
-
def self.included( base )
|
36
|
-
|
35
|
+
def self.included( base ) # rubocop:disable Metrics/MethodLength
|
37
36
|
# @!attribute [rw]
|
38
37
|
# @return [Scorpion::Nest] the singleton nest used by controllers.
|
39
38
|
base.class_attribute :nest_instance
|
@@ -45,8 +44,9 @@ module Scorpion
|
|
45
44
|
def self.nest
|
46
45
|
nest_instance || ( self.nest = Scorpion.instance.build_nest )
|
47
46
|
end
|
47
|
+
|
48
48
|
def self.nest=( value )
|
49
|
-
nest_instance
|
49
|
+
nest_instance&.destroy
|
50
50
|
self.nest_instance = value
|
51
51
|
end
|
52
52
|
|
@@ -60,14 +60,14 @@ module Scorpion
|
|
60
60
|
# of a scorpion is conceived to handle an idividual request.
|
61
61
|
# @param (see DependencyMap#hunt_for )
|
62
62
|
def self.hunt_for( *args, &block )
|
63
|
-
instance_hunts << [:hunt_for,args,block]
|
63
|
+
instance_hunts << [:hunt_for, args, block]
|
64
64
|
end
|
65
65
|
|
66
66
|
# Define dependency resolution that isn't resolved until an instance
|
67
67
|
# of a scorpion is conceived to handle an idividual request.
|
68
68
|
# @param (see DependencyMap#capture )
|
69
69
|
def self.capture( *args, &block )
|
70
|
-
instance_hunts << [:capture,args,block]
|
70
|
+
instance_hunts << [:capture, args, block]
|
71
71
|
end
|
72
72
|
|
73
73
|
# Hunting dependencies that cannot be resolved until an instance
|
@@ -106,9 +106,9 @@ module Scorpion
|
|
106
106
|
|
107
107
|
def append_instance_hunts( scorpion )
|
108
108
|
scorpion.prepare do |hunter|
|
109
|
-
self.class.instance_hunts.each do |method,args,block|
|
110
|
-
hunter.send method, *args do |*
|
111
|
-
instance_exec *
|
109
|
+
self.class.instance_hunts.each do |method, args, block|
|
110
|
+
hunter.send method, *args do |*method_args|
|
111
|
+
instance_exec *method_args, &block
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -125,4 +125,4 @@ module Scorpion
|
|
125
125
|
|
126
126
|
end
|
127
127
|
end
|
128
|
-
end
|
128
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "rails/railtie"
|
2
2
|
require "scorpion/rack/middleware"
|
3
3
|
|
4
4
|
module Scorpion
|
5
5
|
module Rails
|
6
6
|
class Railtie < ::Rails::Railtie
|
7
7
|
|
8
|
-
initializer "scorpion.configure" do |
|
8
|
+
initializer "scorpion.configure" do |_app|
|
9
9
|
::ActionController::Base.send :include, Scorpion::Rails::Controller if defined? ::ActionController
|
10
10
|
::ActiveJob::Base.send :include, Scorpion::Rails::Job if defined? ::ActiveJob
|
11
11
|
::ActionMailer::Base.send :include, Scorpion::Rails::Mailer if defined? ::ActionMailer
|
data/lib/scorpion/rspec.rb
CHANGED
@@ -3,7 +3,7 @@ module Scorpion
|
|
3
3
|
module Helper
|
4
4
|
|
5
5
|
def self.included( base )
|
6
|
-
base.let( :scorpion ){ Scorpion::Rspec.scorpion_nest.conceive }
|
6
|
+
base.let( :scorpion ) { Scorpion::Rspec.scorpion_nest.conceive }
|
7
7
|
base.send :extend, Scorpion::Rspec::Helper::Methods
|
8
8
|
|
9
9
|
|
@@ -44,7 +44,7 @@ module Scorpion
|
|
44
44
|
# Specify a specific hunting contract and prepare a `let` block of the
|
45
45
|
# same name.
|
46
46
|
def hunt( name, contract, value = :unspecified, &block )
|
47
|
-
block ||= ->{ value == :unspecified ? instance_double( contract ) : value }
|
47
|
+
block ||= -> { value == :unspecified ? instance_double( contract ) : value }
|
48
48
|
|
49
49
|
let( name, &block )
|
50
50
|
|
@@ -63,7 +63,7 @@ module Scorpion
|
|
63
63
|
|
64
64
|
def hunt!( name, contract, value = :unspecified, &block )
|
65
65
|
hunt name, contract, value, &block
|
66
|
-
before(:each){ send name }
|
66
|
+
before(:each) { send name }
|
67
67
|
end
|
68
68
|
|
69
69
|
# Captures an instance of the given `contract` and assigns it to `name`
|
data/lib/scorpion/stinger.rb
CHANGED
@@ -7,21 +7,22 @@ module Scorpion
|
|
7
7
|
return instance unless instance
|
8
8
|
|
9
9
|
klass = @wrappers[instance.class] ||=
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
10
|
+
Class.new( instance.class ) do
|
11
|
+
def initialize( instance, stinger )
|
12
|
+
@__instance__ = instance
|
13
|
+
@__stinger__ = stinger
|
14
|
+
end
|
15
|
+
|
16
|
+
def respond_to?( *args )
|
17
|
+
@__instance__.respond_to?( *args )
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def method_missing( *args, &block ) # rubocop:disable Style/MethodMissing
|
23
|
+
@__stinger__.sting! @__instance__.__send__( *args, &block )
|
24
|
+
end
|
25
|
+
end
|
25
26
|
|
26
27
|
klass.new instance, stinger
|
27
28
|
end
|
@@ -49,7 +50,7 @@ module Scorpion
|
|
49
50
|
# Only set scorpion if it hasn't been set yet.
|
50
51
|
current_scorpion = object.send :scorpion
|
51
52
|
if current_scorpion
|
52
|
-
scorpion.logger.warn I18n.translate :mixed_scorpions, scope: [:scorpion
|
53
|
+
scorpion.logger.warn I18n.translate :mixed_scorpions, scope: [:scorpion, :warnings, :messages] if current_scorpion != scorpion # rubocop:disable Metrics/LineLength
|
53
54
|
else
|
54
55
|
object.send :scorpion=, scorpion
|
55
56
|
end
|
@@ -59,9 +60,9 @@ module Scorpion
|
|
59
60
|
return unless objects.respond_to? :each
|
60
61
|
|
61
62
|
# Don't eager load relations that haven't been loaded yet.
|
62
|
-
return if objects.respond_to?( :loaded? ) && !
|
63
|
+
return if objects.respond_to?( :loaded? ) && !objects.loaded?
|
63
64
|
|
64
|
-
objects.each{ |v| sting! v }
|
65
|
+
objects.each { |v| sting! v }
|
65
66
|
end
|
66
67
|
|
67
68
|
end
|
data/lib/scorpion/version.rb
CHANGED
data/scorpion.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path(
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "scorpion/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "scorpion-ioc"
|
8
|
-
spec.version = "#{Scorpion::VERSION}"
|
8
|
+
spec.version = "#{ Scorpion::VERSION }"
|
9
9
|
spec.authors = ["Paul Alexander"]
|
10
10
|
spec.email = ["me@phallguy.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = "Add IoC to rails with minimal fuss and ceremony"
|
12
|
+
spec.description = "Embrace convention over configuration while still benefitting from dependency injection design principles." # rubocop:disable Metrics/LineLength
|
13
13
|
spec.homepage = "https://github.com/phallguy/scorpion"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency
|
22
|
-
spec.required_ruby_version =
|
21
|
+
spec.add_dependency "rails", ">= 4.0"
|
22
|
+
spec.required_ruby_version = ">= 2.0.0"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
25
|
-
spec.add_development_dependency "rake",
|
26
|
-
spec.add_development_dependency "rspec",
|
27
|
-
spec.add_development_dependency "rspec-rails",
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
25
|
+
spec.add_development_dependency "rake", "~> 10"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.00"
|
27
|
+
spec.add_development_dependency "rspec-rails", "~> 3.00"
|
28
|
+
spec.add_development_dependency "combustion", "~> 0.5.3"
|
29
|
+
spec.add_development_dependency "sqlite3"
|
30
30
|
end
|
data/spec/internal/db/schema.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Scorpion::AttributeSet do
|
4
|
-
let( :set ){ Scorpion::AttributeSet.new }
|
4
|
+
let( :set ) { Scorpion::AttributeSet.new }
|
5
5
|
|
6
6
|
it "yields attributes" do
|
7
7
|
set.define do
|
8
|
-
apples
|
8
|
+
apples "apples"
|
9
9
|
end
|
10
10
|
expect( set.first ).to be_a Scorpion::Attribute
|
11
11
|
end
|
@@ -42,24 +42,6 @@ describe Scorpion::AttributeSet do
|
|
42
42
|
expect( set[:logger] ).to be_lazy
|
43
43
|
end
|
44
44
|
|
45
|
-
it "parses traits" do
|
46
|
-
set.define do
|
47
|
-
with_traits nil, :color
|
48
|
-
end
|
49
|
-
|
50
|
-
expect( set[:with_traits].traits ).to eq [:color]
|
51
|
-
end
|
52
|
-
|
53
|
-
it "parses traits and options" do
|
54
|
-
set.define do
|
55
|
-
both nil, :formatted, lazy: true
|
56
|
-
end
|
57
|
-
|
58
|
-
expect( set[:both] ).to be_formatted
|
59
|
-
expect( set[:both] ).to be_lazy
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
45
|
it "parses options" do
|
64
46
|
set.define do
|
65
47
|
options nil, lazy: true
|
@@ -86,4 +68,4 @@ describe Scorpion::AttributeSet do
|
|
86
68
|
end
|
87
69
|
end
|
88
70
|
|
89
|
-
end
|
71
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Test
|
4
4
|
class Attr; end
|
@@ -6,13 +6,8 @@ end
|
|
6
6
|
|
7
7
|
|
8
8
|
describe Scorpion::Attribute do
|
9
|
-
it "responds to trait? methods" do
|
10
|
-
attr = Scorpion::Attribute.new :name, :contract, :formatted
|
11
|
-
expect( attr ).to be_formatted
|
12
|
-
end
|
13
|
-
|
14
9
|
it "resolves contract strings to constants" do
|
15
|
-
attr = Scorpion::Attribute.new :name,
|
10
|
+
attr = Scorpion::Attribute.new :name, "Test::Attr"
|
16
11
|
expect( attr.contract ).to be Test::Attr
|
17
12
|
end
|
18
|
-
end
|
13
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Scorpion::Dependency::ArgumentDependency do
|
4
4
|
let( :dependency ) { Scorpion::Dependency::ArgumentDependency.new( arg ) }
|
5
|
-
let( :arg )
|
5
|
+
let( :arg ) { "Hello" }
|
6
6
|
|
7
7
|
it "matches the same type" do
|
8
8
|
expect( dependency.satisfies?( String ) ).to be_truthy
|
@@ -11,8 +11,4 @@ describe Scorpion::Dependency::ArgumentDependency do
|
|
11
11
|
it "doesn't match different types" do
|
12
12
|
expect( dependency.satisfies?( Regexp ) ).to be_falsy
|
13
13
|
end
|
14
|
-
|
15
|
-
it "doesn't match traits" do
|
16
|
-
expect( dependency.satisfies?( String, :password ) ).to be_falsy
|
17
|
-
end
|
18
|
-
end
|
14
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Test
|
4
4
|
module BuilderDependency
|
@@ -19,23 +19,23 @@ module Test
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe Scorpion::Dependency::BuilderDependency do
|
22
|
-
let( :scorpion ){ double }
|
23
|
-
let( :hunt ){ Scorpion::Hunt.new( scorpion, String, nil ) }
|
22
|
+
let( :scorpion ) { double }
|
23
|
+
let( :hunt ) { Scorpion::Hunt.new( scorpion, String, nil ) }
|
24
24
|
|
25
25
|
it "supports class hunting delegates" do
|
26
|
-
dependency = Scorpion::Dependency::BuilderDependency.new( String,
|
26
|
+
dependency = Scorpion::Dependency::BuilderDependency.new( String, Test::BuilderDependency::ClassDelegate.new )
|
27
27
|
expect( dependency.fetch( hunt ) ).to be Test
|
28
28
|
end
|
29
29
|
|
30
30
|
it "supports module hunting delegates" do
|
31
|
-
dependency = Scorpion::Dependency::BuilderDependency.new( String,
|
31
|
+
dependency = Scorpion::Dependency::BuilderDependency.new( String, Test::BuilderDependency::ModDelegate )
|
32
32
|
expect( dependency.fetch( hunt ) ).to be Test
|
33
33
|
end
|
34
34
|
|
35
35
|
it "supports block hunting delegates" do
|
36
|
-
dependency = Scorpion::Dependency::BuilderDependency.new( String
|
36
|
+
dependency = Scorpion::Dependency::BuilderDependency.new( String ) do
|
37
37
|
Test
|
38
38
|
end
|
39
39
|
expect( dependency.fetch( hunt ) ).to be Test
|
40
40
|
end
|
41
|
-
end
|
41
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Test
|
4
4
|
module ModuleDependency
|
@@ -6,8 +6,8 @@ module Test
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
describe Scorpion::Dependency::ModuleDependency do
|
9
|
-
let( :scorpion ){ double }
|
10
|
-
let( :dependency )
|
9
|
+
let( :scorpion ) { double }
|
10
|
+
let( :dependency ) { Scorpion::Dependency::ModuleDependency.new( Test::ModuleDependency::Example ) }
|
11
11
|
|
12
12
|
it "returns the module itself" do
|
13
13
|
expect( dependency.fetch( scorpion ) ).to be Test::ModuleDependency::Example
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Test
|
4
4
|
module DependencyMap
|
@@ -8,8 +8,8 @@ module Test
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe Scorpion::DependencyMap do
|
11
|
-
let( :scorpion ){ double Scorpion }
|
12
|
-
let( :map ){ Scorpion::DependencyMap.new scorpion }
|
11
|
+
let( :scorpion ) { double Scorpion }
|
12
|
+
let( :map ) { Scorpion::DependencyMap.new scorpion }
|
13
13
|
|
14
14
|
describe "#chart" do
|
15
15
|
it "yields itself when arg expected" do
|
@@ -45,27 +45,6 @@ describe Scorpion::DependencyMap do
|
|
45
45
|
expect( map.find( Test::DependencyMap::Armor ) ).to be_nil
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
context "multiple possible matches" do
|
50
|
-
before( :each ) do
|
51
|
-
map.chart do
|
52
|
-
hunt_for Test::DependencyMap::Weapon, [ :sharp, :one_handed ]
|
53
|
-
hunt_for Test::DependencyMap::Weapon, [ :blunt, :one_handed ]
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
it "returns the last dependency that matches one trait" do
|
58
|
-
expect( map.find( Test::DependencyMap::Weapon, :one_handed ).traits ).to include :blunt
|
59
|
-
end
|
60
|
-
|
61
|
-
it "returns the last dependency that matches all of the traits" do
|
62
|
-
expect( map.find( Test::DependencyMap::Weapon, [ :one_handed, :blunt ] ).traits ).to include :blunt
|
63
|
-
end
|
64
|
-
|
65
|
-
it "returns the last dependency that matches a unique trait" do
|
66
|
-
expect( map.find( Test::DependencyMap::Weapon, :blunt ).traits ).to include :blunt
|
67
|
-
end
|
68
|
-
end
|
69
48
|
end
|
70
49
|
|
71
50
|
describe "#hunt_for" do
|
@@ -107,4 +86,4 @@ describe Scorpion::DependencyMap do
|
|
107
86
|
expect( replica ).not_to be_empty
|
108
87
|
end
|
109
88
|
end
|
110
|
-
end
|
89
|
+
end
|