rr 0.10.10 → 0.10.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/CHANGES +4 -0
  2. data/VERSION.yml +1 -1
  3. data/lib/rr.rb +5 -3
  4. data/lib/rr/adapters/rr_methods.rb +5 -5
  5. data/lib/rr/blank_slate.rb +17 -0
  6. data/lib/rr/double_definitions/{child_double_definition_creator.rb → child_double_definition_create.rb} +1 -1
  7. data/lib/rr/double_definitions/double_definition.rb +13 -11
  8. data/lib/rr/double_definitions/{double_definition_creator.rb → double_definition_create.rb} +52 -43
  9. data/lib/rr/double_definitions/double_definition_create_blank_slate.rb +26 -0
  10. data/lib/rr/double_definitions/strategies/implementation/implementation_strategy.rb +2 -2
  11. data/lib/rr/double_definitions/strategies/scope/instance.rb +1 -1
  12. data/lib/rr/double_definitions/strategies/scope/instance_of_class.rb +6 -6
  13. data/lib/rr/double_definitions/strategies/scope/scope_strategy.rb +2 -2
  14. data/lib/rr/double_definitions/strategies/strategy.rb +15 -16
  15. data/lib/rr/double_definitions/strategies/verification/mock.rb +1 -1
  16. data/lib/rr/double_definitions/strategies/verification/stub.rb +1 -1
  17. data/lib/rr/double_definitions/strategies/verification/verification_strategy.rb +2 -2
  18. data/lib/rr/injections/double_injection.rb +59 -4
  19. data/lib/rr/injections/injection.rb +6 -0
  20. data/lib/rr/injections/method_missing_injection.rb +13 -1
  21. data/lib/rr/injections/singleton_method_added_injection.rb +14 -3
  22. data/lib/rr/method_dispatches/base_method_dispatch.rb +2 -2
  23. data/lib/rr/method_dispatches/method_missing_dispatch.rb +2 -2
  24. data/lib/rr/recorded_calls.rb +1 -1
  25. data/lib/rr/space.rb +17 -68
  26. data/lib/rr/spy_verification_proxy.rb +1 -6
  27. data/spec/rr/adapters/rr_methods_creator_spec.rb +9 -21
  28. data/spec/rr/adapters/rr_methods_space_spec.rb +10 -25
  29. data/spec/rr/double_definitions/child_double_definition_creator_spec.rb +16 -16
  30. data/spec/rr/double_definitions/double_definition_create_blank_slate_spec.rb +87 -0
  31. data/spec/rr/double_definitions/{double_definition_creator_spec.rb → double_definition_create_spec.rb} +64 -72
  32. data/spec/rr/double_injection/double_injection_verify_spec.rb +2 -2
  33. data/spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb +5 -29
  34. data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb +7 -39
  35. data/spec/rr/expectations/times_called_expectation/times_called_expectation_at_most_spec.rb +19 -47
  36. data/spec/rr/expectations/times_called_expectation/times_called_expectation_helper.rb +1 -9
  37. data/spec/rr/expectations/times_called_expectation/times_called_expectation_integer_spec.rb +18 -64
  38. data/spec/rr/expectations/times_called_expectation/times_called_expectation_proc_spec.rb +7 -53
  39. data/spec/rr/expectations/times_called_expectation/times_called_expectation_range_spec.rb +12 -56
  40. data/spec/rr/rspec/rspec_adapter_spec.rb +8 -11
  41. data/spec/rr/space/space_spec.rb +72 -212
  42. data/spec/spec_helper.rb +0 -76
  43. data/spec/spy_verification_spec.rb +1 -1
  44. metadata +8 -11
  45. data/lib/rr/double_definitions/double_definition_creator_proxy.rb +0 -37
  46. data/ruby_19_spec.rb +0 -12
  47. data/spec/rr/double_definitions/double_definition_creator_proxy_spec.rb +0 -124
  48. data/spec/rr/double_definitions/double_definition_spec.rb +0 -1168
  49. data/spec/rr/double_spec.rb +0 -361
  50. data/spec/rr/expectations/times_called_expectation/times_called_expectation_spec.rb +0 -38
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ 0.10.11
2
+ - Added RR.blank_slate_whitelist
3
+ - Fixed class_eval method redefinition warning in jruby
4
+
1
5
  0.10.10
2
6
  - Suite passes for Ruby 1.9.1
3
7
 
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
3
  :minor: 10
4
- :patch: 10
4
+ :patch: 11
5
5
  :major: 0
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/double_definition_creator_proxy"
30
- require "#{dir}/rr/double_definitions/double_definition_creator"
31
- require "#{dir}/rr/double_definitions/child_double_definition_creator"
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::DoubleDefinitionCreator::NO_SUBJECT, method_name=nil, &definition_eval_block)
8
- creator = DoubleDefinitions::DoubleDefinitionCreator.new
9
- creator.#{method_name}(subject, method_name, &definition_eval_block)
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
- creator = DoubleDefinitions::DoubleDefinitionCreator.new
16
- creator.#{method_name}!(method_name, &definition_eval_block)
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 ChildDoubleDefinitionCreator < DoubleDefinitionCreator # :nodoc
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=DoubleDefinitionCreator::NO_SUBJECT, method_name=nil, &definition_eval_block)
8
- ChildDoubleDefinitionCreator.new(self).#{method_name}(subject, method_name, &definition_eval_block)
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
- ChildDoubleDefinitionCreator.new(self).#{method_name}!(method_name, &definition_eval_block)
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
- :double_definition_creator,
29
- :subject
28
+ :double_definition_create
30
29
  )
31
30
 
32
31
  include Space::Reader
33
32
 
34
- def initialize(double_definition_creator, subject)
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
- @double_definition_creator = double_definition_creator
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
- double_definition_creator.root_subject
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
- DoubleDefinitionCreatorProxy.new(double_definition_creator)
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
- double_definition_creator.implementation_strategy
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 DoubleDefinitionCreator # :nodoc
3
+ class DoubleDefinitionCreate # :nodoc
4
4
  class << self
5
- def register_verification_strategy_class(strategy_class, method_name)
5
+ def register_verification_strategy_class(strategy_class, strategy_method_name)
6
6
  class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
7
- def #{method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
8
- add_strategy(subject, method_name, definition_eval_block) do
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 #{method_name}!(method_name=nil, &definition_eval_block)
16
- #{method_name}(Object.new, method_name, &definition_eval_block)
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, method_name)
19
+ def register_implementation_strategy_class(strategy_class, strategy_method_name)
22
20
  class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
23
- def #{method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
24
- add_strategy(subject, method_name, definition_eval_block) do
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 #{method_name}!(method_name=nil, &definition_eval_block)
32
- #{method_name}(Object.new, method_name, &definition_eval_block)
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, method_name)
33
+ def register_scope_strategy_class(strategy_class, strategy_method_name)
38
34
  class_eval((<<-CLASS), __FILE__, __LINE__ + 1)
39
- def #{method_name}(subject=NO_SUBJECT, method_name=nil, &definition_eval_block)
40
- add_strategy(subject, method_name, definition_eval_block) do
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 #{method_name}!(method_name=nil, &definition_eval_block)
48
- #{method_name}(Object.new, method_name, &definition_eval_block)
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
- :args, :handler,
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
- create(method_name)
114
+ # TODO: Pass in arguments.
115
+ call(method_name)
94
116
  else
95
- DoubleDefinitionCreatorProxy.new(self, &definition_eval_block)
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
- module StrategyExecutionMethods
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 register_self_at_double_definition_creator(domain_name)
8
- DoubleDefinitionCreator.register_implementation_strategy_class(self, domain_name)
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 = space.double_injection(subject, method_name)
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 !double_definition_creator.no_subject? && !double_definition_creator.subject.is_a?(Class)
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
- instance_of_subject_creator = DoubleDefinitionCreator.new
30
- instance_of_subject_creator.strong if definition.verify_method_signature?
31
- instance_of_subject_creator.stub(subject)
32
- instance_of_subject_creator.create(:new) do |*args|
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 = space.double_injection(instance, method_name)
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 register_self_at_double_definition_creator(domain_name)
8
- DoubleDefinitionCreator.register_scope_strategy_class(self, domain_name)
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 :domain_name
7
- def register(domain_name, *alias_method_names)
8
- @domain_name = domain_name
9
- register_self_at_double_definition_creator(domain_name)
10
- DoubleDefinitionCreator.class_eval do
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, domain_name
12
+ alias_method alias_method_name, strategy_method_name
13
13
  end
14
14
  end
15
- RR::Adapters::RRMethods.register_strategy_class(self, domain_name)
16
- DoubleDefinition.register_strategy_class(self, domain_name)
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, domain_name
19
+ alias_method alias_method_name, strategy_method_name
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
- def register_self_at_double_definition_creator(domain_name)
24
+ def register_self_at_double_definition_create(strategy_method_name)
25
25
  end
26
26
  end
27
27
 
28
- attr_reader :double_definition_creator, :definition, :method_name, :args, :handler
28
+ attr_reader :double_definition_create, :definition, :method_name, :args, :handler
29
29
  include Space::Reader
30
30
 
31
- def initialize(double_definition_creator)
32
- @double_definition_creator = double_definition_creator
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.domain_name
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
- rv = definition.returns(&handler)
62
-
61
+ definition.returns(&handler)
63
62
  end
64
63
 
65
64
  def subject