rr 0.10.10 → 0.10.11
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.
- data/CHANGES +4 -0
- data/VERSION.yml +1 -1
- data/lib/rr.rb +5 -3
- data/lib/rr/adapters/rr_methods.rb +5 -5
- data/lib/rr/blank_slate.rb +17 -0
- data/lib/rr/double_definitions/{child_double_definition_creator.rb → child_double_definition_create.rb} +1 -1
- data/lib/rr/double_definitions/double_definition.rb +13 -11
- data/lib/rr/double_definitions/{double_definition_creator.rb → double_definition_create.rb} +52 -43
- data/lib/rr/double_definitions/double_definition_create_blank_slate.rb +26 -0
- data/lib/rr/double_definitions/strategies/implementation/implementation_strategy.rb +2 -2
- data/lib/rr/double_definitions/strategies/scope/instance.rb +1 -1
- data/lib/rr/double_definitions/strategies/scope/instance_of_class.rb +6 -6
- data/lib/rr/double_definitions/strategies/scope/scope_strategy.rb +2 -2
- data/lib/rr/double_definitions/strategies/strategy.rb +15 -16
- data/lib/rr/double_definitions/strategies/verification/mock.rb +1 -1
- data/lib/rr/double_definitions/strategies/verification/stub.rb +1 -1
- data/lib/rr/double_definitions/strategies/verification/verification_strategy.rb +2 -2
- data/lib/rr/injections/double_injection.rb +59 -4
- data/lib/rr/injections/injection.rb +6 -0
- data/lib/rr/injections/method_missing_injection.rb +13 -1
- data/lib/rr/injections/singleton_method_added_injection.rb +14 -3
- data/lib/rr/method_dispatches/base_method_dispatch.rb +2 -2
- data/lib/rr/method_dispatches/method_missing_dispatch.rb +2 -2
- data/lib/rr/recorded_calls.rb +1 -1
- data/lib/rr/space.rb +17 -68
- data/lib/rr/spy_verification_proxy.rb +1 -6
- data/spec/rr/adapters/rr_methods_creator_spec.rb +9 -21
- data/spec/rr/adapters/rr_methods_space_spec.rb +10 -25
- data/spec/rr/double_definitions/child_double_definition_creator_spec.rb +16 -16
- data/spec/rr/double_definitions/double_definition_create_blank_slate_spec.rb +87 -0
- data/spec/rr/double_definitions/{double_definition_creator_spec.rb → double_definition_create_spec.rb} +64 -72
- data/spec/rr/double_injection/double_injection_verify_spec.rb +2 -2
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb +5 -29
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb +7 -39
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_most_spec.rb +19 -47
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_helper.rb +1 -9
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_integer_spec.rb +18 -64
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_proc_spec.rb +7 -53
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_range_spec.rb +12 -56
- data/spec/rr/rspec/rspec_adapter_spec.rb +8 -11
- data/spec/rr/space/space_spec.rb +72 -212
- data/spec/spec_helper.rb +0 -76
- data/spec/spy_verification_spec.rb +1 -1
- metadata +8 -11
- data/lib/rr/double_definitions/double_definition_creator_proxy.rb +0 -37
- data/ruby_19_spec.rb +0 -12
- data/spec/rr/double_definitions/double_definition_creator_proxy_spec.rb +0 -124
- data/spec/rr/double_definitions/double_definition_spec.rb +0 -1168
- data/spec/rr/double_spec.rb +0 -361
- data/spec/rr/expectations/times_called_expectation/times_called_expectation_spec.rb +0 -38
data/CHANGES
CHANGED
data/VERSION.yml
CHANGED
data/lib/rr.rb
CHANGED
@@ -2,6 +2,8 @@ dir = File.dirname(__FILE__)
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'forwardable'
|
4
4
|
|
5
|
+
require "#{dir}/rr/blank_slate"
|
6
|
+
|
5
7
|
require "#{dir}/rr/errors/rr_error"
|
6
8
|
require "#{dir}/rr/errors/subject_does_not_implement_method_error"
|
7
9
|
require "#{dir}/rr/errors/subject_has_different_arity_error"
|
@@ -26,9 +28,9 @@ require "#{dir}/rr/hash_with_object_id_key"
|
|
26
28
|
require "#{dir}/rr/recorded_calls"
|
27
29
|
require "#{dir}/rr/proc_from_block"
|
28
30
|
|
29
|
-
require "#{dir}/rr/double_definitions/
|
30
|
-
require "#{dir}/rr/double_definitions/
|
31
|
-
require "#{dir}/rr/double_definitions/
|
31
|
+
require "#{dir}/rr/double_definitions/double_definition_create_blank_slate"
|
32
|
+
require "#{dir}/rr/double_definitions/double_definition_create"
|
33
|
+
require "#{dir}/rr/double_definitions/child_double_definition_create"
|
32
34
|
require "#{dir}/rr/adapters/rr_methods"
|
33
35
|
|
34
36
|
require "#{dir}/rr/double"
|
@@ -4,16 +4,16 @@ module RR
|
|
4
4
|
class << self
|
5
5
|
def register_strategy_class(strategy_class, method_name)
|
6
6
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
7
|
-
def #{method_name}(subject=DoubleDefinitions::
|
8
|
-
|
9
|
-
|
7
|
+
def #{method_name}(subject=DoubleDefinitions::DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
|
8
|
+
double_definition_create = DoubleDefinitions::DoubleDefinitionCreate.new
|
9
|
+
double_definition_create.#{method_name}(subject, method_name, &definition_eval_block)
|
10
10
|
end
|
11
11
|
CLASS
|
12
12
|
|
13
13
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
14
14
|
def #{method_name}!(method_name=nil, &definition_eval_block)
|
15
|
-
|
16
|
-
|
15
|
+
double_definition_create = DoubleDefinitions::DoubleDefinitionCreate.new
|
16
|
+
double_definition_create.#{method_name}!(method_name, &definition_eval_block)
|
17
17
|
end
|
18
18
|
CLASS
|
19
19
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module RR
|
2
|
+
module BlankSlate
|
3
|
+
class << self
|
4
|
+
def call(klass)
|
5
|
+
klass.instance_eval do
|
6
|
+
instance_methods.each do |unformatted_method_name|
|
7
|
+
method_name = unformatted_method_name.to_s
|
8
|
+
unless method_name =~ /^_/ || Space.blank_slate_whitelist.any? {|whitelisted_method_name| method_name == whitelisted_method_name}
|
9
|
+
alias_method "__blank_slated_#{method_name}", method_name
|
10
|
+
undef_method method_name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module RR
|
2
2
|
module DoubleDefinitions
|
3
|
-
class
|
3
|
+
class ChildDoubleDefinitionCreate < DoubleDefinitionCreate # :nodoc
|
4
4
|
attr_reader :parent_double_definition
|
5
5
|
def initialize(parent_double_definition)
|
6
6
|
@parent_double_definition = parent_double_definition
|
@@ -4,14 +4,14 @@ module RR
|
|
4
4
|
class << self
|
5
5
|
def register_strategy_class(strategy_class, method_name)
|
6
6
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
7
|
-
def #{method_name}(subject=
|
8
|
-
|
7
|
+
def #{method_name}(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
|
8
|
+
ChildDoubleDefinitionCreate.new(self).#{method_name}(subject, method_name, &definition_eval_block)
|
9
9
|
end
|
10
10
|
CLASS
|
11
11
|
|
12
12
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
13
13
|
def #{method_name}!(method_name=nil, &definition_eval_block)
|
14
|
-
|
14
|
+
ChildDoubleDefinitionCreate.new(self).#{method_name}!(method_name, &definition_eval_block)
|
15
15
|
end
|
16
16
|
CLASS
|
17
17
|
end
|
@@ -25,20 +25,18 @@ module RR
|
|
25
25
|
:after_call_proc,
|
26
26
|
:yields_value,
|
27
27
|
:double,
|
28
|
-
:
|
29
|
-
:subject
|
28
|
+
:double_definition_create
|
30
29
|
)
|
31
30
|
|
32
31
|
include Space::Reader
|
33
32
|
|
34
|
-
def initialize(
|
33
|
+
def initialize(double_definition_create)
|
35
34
|
@implementation = nil
|
36
35
|
@argument_expectation = nil
|
37
36
|
@times_matcher = nil
|
38
37
|
@after_call_proc = nil
|
39
38
|
@yields_value = nil
|
40
|
-
@
|
41
|
-
@subject = subject
|
39
|
+
@double_definition_create = double_definition_create
|
42
40
|
@ordered = false
|
43
41
|
@verbose = false
|
44
42
|
@verify_method_signature = false
|
@@ -46,8 +44,12 @@ module RR
|
|
46
44
|
|
47
45
|
attr_reader :argument_expectation
|
48
46
|
|
47
|
+
def subject
|
48
|
+
double_definition_create.subject
|
49
|
+
end
|
50
|
+
|
49
51
|
def root_subject
|
50
|
-
|
52
|
+
double_definition_create.root_subject
|
51
53
|
end
|
52
54
|
|
53
55
|
module ArgumentDefinitionConstructionMethods
|
@@ -196,7 +198,7 @@ module RR
|
|
196
198
|
@ordered = true
|
197
199
|
space.register_ordered_double(@double)
|
198
200
|
install_method_callback return_value_block
|
199
|
-
|
201
|
+
DoubleDefinitionCreateBlankSlate.new(double_definition_create)
|
200
202
|
end
|
201
203
|
alias_method :then, :ordered
|
202
204
|
|
@@ -343,7 +345,7 @@ module RR
|
|
343
345
|
|
344
346
|
protected
|
345
347
|
def implementation_strategy
|
346
|
-
|
348
|
+
double_definition_create.implementation_strategy
|
347
349
|
end
|
348
350
|
end
|
349
351
|
include StateQueryMethods
|
@@ -1,60 +1,52 @@
|
|
1
1
|
module RR
|
2
2
|
module DoubleDefinitions
|
3
|
-
class
|
3
|
+
class DoubleDefinitionCreate # :nodoc
|
4
4
|
class << self
|
5
|
-
def register_verification_strategy_class(strategy_class,
|
5
|
+
def register_verification_strategy_class(strategy_class, strategy_method_name)
|
6
6
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
7
|
-
def #{
|
8
|
-
|
9
|
-
self.verification_strategy = #{strategy_class.name}.new(self)
|
10
|
-
end
|
7
|
+
def #{strategy_method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
8
|
+
self.add_verification_strategy(#{strategy_class.name}, subject, method_name, &definition_eval_block)
|
11
9
|
end
|
12
10
|
CLASS
|
13
11
|
|
14
12
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
15
|
-
def #{
|
16
|
-
#{
|
13
|
+
def #{strategy_method_name}!(method_name=nil, &definition_eval_block)
|
14
|
+
#{strategy_method_name}(Object.new, method_name, &definition_eval_block)
|
17
15
|
end
|
18
16
|
CLASS
|
19
17
|
end
|
20
18
|
|
21
|
-
def register_implementation_strategy_class(strategy_class,
|
19
|
+
def register_implementation_strategy_class(strategy_class, strategy_method_name)
|
22
20
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
23
|
-
def #{
|
24
|
-
|
25
|
-
self.implementation_strategy = #{strategy_class.name}.new(self)
|
26
|
-
end
|
21
|
+
def #{strategy_method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
22
|
+
self.add_implementation_strategy(#{strategy_class.name}, subject, method_name, &definition_eval_block)
|
27
23
|
end
|
28
24
|
CLASS
|
29
25
|
|
30
26
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
31
|
-
def #{
|
32
|
-
#{
|
27
|
+
def #{strategy_method_name}!(method_name=nil, &definition_eval_block)
|
28
|
+
#{strategy_method_name}(Object.new, method_name, &definition_eval_block)
|
33
29
|
end
|
34
30
|
CLASS
|
35
31
|
end
|
36
32
|
|
37
|
-
def register_scope_strategy_class(strategy_class,
|
33
|
+
def register_scope_strategy_class(strategy_class, strategy_method_name)
|
38
34
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
39
|
-
def #{
|
40
|
-
|
41
|
-
self.scope_strategy = #{strategy_class.name}.new(self)
|
42
|
-
end
|
35
|
+
def #{strategy_method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
36
|
+
self.add_scope_strategy(#{strategy_class.name}, subject, method_name, &definition_eval_block)
|
43
37
|
end
|
44
38
|
CLASS
|
45
39
|
|
46
40
|
class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
|
47
|
-
def #{
|
48
|
-
#{
|
41
|
+
def #{strategy_method_name}!(method_name=nil, &definition_eval_block)
|
42
|
+
#{strategy_method_name}(Object.new, method_name, &definition_eval_block)
|
49
43
|
end
|
50
44
|
CLASS
|
51
45
|
end
|
52
46
|
end
|
53
47
|
|
54
48
|
attr_reader :subject,
|
55
|
-
:
|
56
|
-
:definition,
|
57
|
-
:verification_strategy,
|
49
|
+
:verification_strategy,
|
58
50
|
:implementation_strategy,
|
59
51
|
:scope_strategy
|
60
52
|
NO_SUBJECT = Object.new
|
@@ -67,9 +59,19 @@ module RR
|
|
67
59
|
@scope_strategy = Strategies::Scope::Instance.new(self)
|
68
60
|
end
|
69
61
|
|
62
|
+
def call(method_name, *args, &handler)
|
63
|
+
raise DoubleDefinitionCreateError if no_subject?
|
64
|
+
definition = DoubleDefinition.new(self)
|
65
|
+
verification_strategy || no_strategy_error
|
66
|
+
verification_strategy.call(definition, method_name, args, handler)
|
67
|
+
implementation_strategy.call(definition, method_name, args, handler)
|
68
|
+
scope_strategy.call(definition, method_name, args, handler)
|
69
|
+
definition
|
70
|
+
end
|
71
|
+
|
70
72
|
def root_subject
|
71
73
|
subject
|
72
|
-
end
|
74
|
+
end
|
73
75
|
|
74
76
|
def method_name
|
75
77
|
@verification_strategy.method_name
|
@@ -81,18 +83,38 @@ module RR
|
|
81
83
|
end
|
82
84
|
|
83
85
|
protected
|
86
|
+
def add_verification_strategy(verification_strategy_class, subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
87
|
+
add_strategy(subject, method_name, definition_eval_block) do
|
88
|
+
self.verification_strategy = verification_strategy_class.new(self)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def add_implementation_strategy(implementation_strategy_class, subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
93
|
+
add_strategy(subject, method_name, definition_eval_block) do
|
94
|
+
self.implementation_strategy = implementation_strategy_class.new(self)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def add_scope_strategy(scope_strategy_class, subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
|
99
|
+
add_strategy(subject, method_name, definition_eval_block) do
|
100
|
+
self.scope_strategy = scope_strategy_class.new(self)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
84
104
|
def add_strategy(subject, method_name, definition_eval_block)
|
85
105
|
if method_name && definition_eval_block
|
86
106
|
raise ArgumentError, "Cannot pass in a method name and a block"
|
87
107
|
end
|
88
108
|
@subject = subject
|
89
109
|
yield
|
110
|
+
# TODO: Allow hash argument to simulate a Struct.
|
90
111
|
if no_subject?
|
91
112
|
self
|
92
113
|
elsif method_name
|
93
|
-
|
114
|
+
# TODO: Pass in arguments.
|
115
|
+
call(method_name)
|
94
116
|
else
|
95
|
-
|
117
|
+
DoubleDefinitionCreateBlankSlate.new(self, &definition_eval_block)
|
96
118
|
end
|
97
119
|
end
|
98
120
|
|
@@ -102,7 +124,7 @@ module RR
|
|
102
124
|
@verification_strategy = verification_strategy
|
103
125
|
verification_strategy
|
104
126
|
end
|
105
|
-
|
127
|
+
|
106
128
|
def implementation_strategy=(implementation_strategy)
|
107
129
|
verify_not_proxy_and_dont_allow(verification_strategy, implementation_strategy)
|
108
130
|
@implementation_strategy = implementation_strategy
|
@@ -146,20 +168,7 @@ module RR
|
|
146
168
|
end
|
147
169
|
include StrategySetupMethods
|
148
170
|
|
149
|
-
|
150
|
-
def create(method_name, *args, &handler)
|
151
|
-
raise DoubleDefinitionCreatorError if no_subject?
|
152
|
-
@method_name, @args, @handler = method_name, args, handler
|
153
|
-
@definition = DoubleDefinition.new(self, subject)
|
154
|
-
verification_strategy ? verification_strategy.call(definition, method_name, args, handler) : no_strategy_error
|
155
|
-
implementation_strategy.call(definition, method_name, args, handler)
|
156
|
-
scope_strategy.call(definition, method_name, args, handler)
|
157
|
-
definition
|
158
|
-
end
|
159
|
-
end
|
160
|
-
include StrategyExecutionMethods
|
161
|
-
|
162
|
-
class DoubleDefinitionCreatorError < Errors::RRError
|
171
|
+
class DoubleDefinitionCreateError < Errors::RRError
|
163
172
|
end
|
164
173
|
end
|
165
174
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module RR
|
2
|
+
module DoubleDefinitions
|
3
|
+
class DoubleDefinitionCreateBlankSlate
|
4
|
+
def initialize(double_definition_create, &block) #:nodoc:
|
5
|
+
@double_definition_create = double_definition_create
|
6
|
+
BlankSlate.call(respond_to?(:class) ? self.class : __blank_slated_class)
|
7
|
+
|
8
|
+
if block_given?
|
9
|
+
if block.arity == 1
|
10
|
+
yield(self)
|
11
|
+
else
|
12
|
+
respond_to?(:instance_eval) ? instance_eval(&block) : __blank_slated_instance_eval(&block)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_missing(method_name, *args, &block)
|
18
|
+
@double_definition_create.call(method_name, *args, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def __double_definition_create__
|
22
|
+
@double_definition_create
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -4,8 +4,8 @@ module RR
|
|
4
4
|
module Implementation
|
5
5
|
class ImplementationStrategy < Strategy
|
6
6
|
class << self
|
7
|
-
def
|
8
|
-
|
7
|
+
def register_self_at_double_definition_create(strategy_method_name)
|
8
|
+
DoubleDefinitionCreate.register_implementation_strategy_class(self, strategy_method_name)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module RR
|
|
5
5
|
class Instance < ScopeStrategy
|
6
6
|
protected
|
7
7
|
def do_call
|
8
|
-
double_injection =
|
8
|
+
double_injection = Injections::DoubleInjection.create(subject, method_name)
|
9
9
|
Double.new(double_injection, definition)
|
10
10
|
end
|
11
11
|
end
|
@@ -19,20 +19,20 @@ module RR
|
|
19
19
|
def initialize(*args)
|
20
20
|
super
|
21
21
|
|
22
|
-
if !
|
22
|
+
if !double_definition_create.no_subject? && !double_definition_create.subject.is_a?(Class)
|
23
23
|
raise ArgumentError, "instance_of only accepts class objects"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
protected
|
28
28
|
def do_call
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
instance_of_subject_double_definition_create = DoubleDefinitionCreate.new
|
30
|
+
instance_of_subject_double_definition_create.strong if definition.verify_method_signature?
|
31
|
+
instance_of_subject_double_definition_create.stub(subject)
|
32
|
+
instance_of_subject_double_definition_create.call(:new) do |*args|
|
33
33
|
#####
|
34
34
|
instance = subject.allocate
|
35
|
-
double_injection =
|
35
|
+
double_injection = Injections::DoubleInjection.create(instance, method_name)
|
36
36
|
Double.new(double_injection, definition)
|
37
37
|
#####
|
38
38
|
if args.last.is_a?(ProcFromBlock)
|
@@ -4,8 +4,8 @@ module RR
|
|
4
4
|
module Scope
|
5
5
|
class ScopeStrategy < Strategy
|
6
6
|
class << self
|
7
|
-
def
|
8
|
-
|
7
|
+
def register_self_at_double_definition_create(strategy_method_name)
|
8
|
+
DoubleDefinitionCreate.register_scope_strategy_class(self, strategy_method_name)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -3,33 +3,33 @@ module RR
|
|
3
3
|
module Strategies
|
4
4
|
class Strategy
|
5
5
|
class << self
|
6
|
-
attr_reader :
|
7
|
-
def register(
|
8
|
-
@
|
9
|
-
|
10
|
-
|
6
|
+
attr_reader :strategy_method_name
|
7
|
+
def register(strategy_method_name, *alias_method_names)
|
8
|
+
@strategy_method_name = strategy_method_name
|
9
|
+
register_self_at_double_definition_create(strategy_method_name)
|
10
|
+
DoubleDefinitionCreate.class_eval do
|
11
11
|
alias_method_names.each do |alias_method_name|
|
12
|
-
alias_method alias_method_name,
|
12
|
+
alias_method alias_method_name, strategy_method_name
|
13
13
|
end
|
14
14
|
end
|
15
|
-
RR::Adapters::RRMethods.register_strategy_class(self,
|
16
|
-
DoubleDefinition.register_strategy_class(self,
|
15
|
+
RR::Adapters::RRMethods.register_strategy_class(self, strategy_method_name)
|
16
|
+
DoubleDefinition.register_strategy_class(self, strategy_method_name)
|
17
17
|
RR::Adapters::RRMethods.class_eval do
|
18
18
|
alias_method_names.each do |alias_method_name|
|
19
|
-
alias_method alias_method_name,
|
19
|
+
alias_method alias_method_name, strategy_method_name
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def register_self_at_double_definition_create(strategy_method_name)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
attr_reader :
|
28
|
+
attr_reader :double_definition_create, :definition, :method_name, :args, :handler
|
29
29
|
include Space::Reader
|
30
30
|
|
31
|
-
def initialize(
|
32
|
-
@
|
31
|
+
def initialize(double_definition_create)
|
32
|
+
@double_definition_create = double_definition_create
|
33
33
|
end
|
34
34
|
|
35
35
|
def call(definition, method_name, args, handler)
|
@@ -38,7 +38,7 @@ module RR
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def name
|
41
|
-
self.class.
|
41
|
+
self.class.strategy_method_name
|
42
42
|
end
|
43
43
|
|
44
44
|
def verify_subject(subject)
|
@@ -58,8 +58,7 @@ module RR
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def reimplementation
|
61
|
-
|
62
|
-
|
61
|
+
definition.returns(&handler)
|
63
62
|
end
|
64
63
|
|
65
64
|
def subject
|