Skip to content

Commit dd3c458

Browse files
committed
stubbed_instance -> callee, stub_owner -> stubbee
1 parent df249eb commit dd3c458

14 files changed

+46
-46
lines changed

test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ class StubAnyInstanceMethodDefinedOnSuperclassTest < Mocha::TestCase
44
include StubMethodSharedTests
55

66
def method_owner
7-
stubbed_instance.class.superclass
7+
callee.class.superclass
88
end
99

10-
def stubbed_instance
11-
@stubbed_instance ||= Class.new(Class.new).new
10+
def callee
11+
@callee ||= Class.new(Class.new).new
1212
end
1313

14-
def stub_owner
15-
stubbed_instance.class.any_instance
14+
def stubbee
15+
callee.class.any_instance
1616
end
1717

1818
def test_expect_method_on_any_instance_of_superclass_even_if_preceded_by_test_expecting_method_on_any_instance_of_subclass
@@ -52,14 +52,14 @@ class StubSuperclassAnyInstanceMethodDefinedOnSuperclassTest < Mocha::TestCase
5252
include StubMethodSharedTests
5353

5454
def method_owner
55-
stubbed_instance.class.superclass
55+
callee.class.superclass
5656
end
5757

58-
def stubbed_instance
59-
@stubbed_instance ||= Class.new(Class.new).new
58+
def callee
59+
@callee ||= Class.new(Class.new).new
6060
end
6161

62-
def stub_owner
62+
def stubbee
6363
method_owner.any_instance
6464
end
6565
end

test/acceptance/stub_any_instance_method_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ def method_owner
77
@method_owner ||= Class.new
88
end
99

10-
def stubbed_instance
10+
def callee
1111
method_owner.new
1212
end
1313

14-
def stub_owner
14+
def stubbee
1515
method_owner.any_instance
1616
end
1717

@@ -128,11 +128,11 @@ def method_owner
128128
@method_owner ||= Class.new.send(:include, module_with_private_method)
129129
end
130130

131-
def stubbed_instance
131+
def callee
132132
method_owner.new
133133
end
134134

135-
def stub_owner
135+
def stubbee
136136
method_owner.any_instance
137137
end
138138

test/acceptance/stub_class_method_defined_on_class_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ class StubClassMethodDefinedOnClassTest < Mocha::TestCase
44
include StubMethodSharedTests
55

66
def method_owner
7-
stubbed_instance.singleton_class
7+
callee.singleton_class
88
end
99

10-
def stubbed_instance
11-
@stubbed_instance ||= Class.new
10+
def callee
11+
@callee ||= Class.new
1212
end
1313
end

test/acceptance/stub_class_method_defined_on_module_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def method_owner
77
@method_owner ||= Module.new
88
end
99

10-
def stubbed_instance
10+
def callee
1111
Class.new.extend(method_owner)
1212
end
1313
end

test/acceptance/stub_class_method_defined_on_superclass_test.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ class StubClassMethodDefinedOnSuperclassTest < Mocha::TestCase
44
include StubMethodSharedTests
55

66
def method_owner
7-
stubbed_instance.superclass.singleton_class
7+
callee.superclass.singleton_class
88
end
99

10-
def stubbed_instance
11-
@stubbed_instance ||= Class.new(Class.new)
10+
def callee
11+
@callee ||= Class.new(Class.new)
1212
end
1313

1414
def test_stub_on_earliest_receiver_should_take_priority
@@ -65,14 +65,14 @@ class StubSuperclassClassMethodDefinedOnSuperclassTest < Mocha::TestCase
6565
include StubMethodSharedTests
6666

6767
def method_owner
68-
stubbed_instance.superclass.singleton_class
68+
callee.superclass.singleton_class
6969
end
7070

71-
def stubbed_instance
72-
@stubbed_instance ||= Class.new(Class.new)
71+
def callee
72+
@callee ||= Class.new(Class.new)
7373
end
7474

75-
def stub_owner
76-
stubbed_instance.superclass
75+
def stubbee
76+
callee.superclass
7777
end
7878
end

test/acceptance/stub_instance_method_defined_on_class_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def method_owner
77
@method_owner ||= Class.new
88
end
99

10-
def stubbed_instance
10+
def callee
1111
method_owner.new
1212
end
1313
end

test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def method_owner
55
Kernel
66
end
77

8-
def stubbed_instance
8+
def callee
99
Class.new.new
1010
end
1111
end
@@ -15,7 +15,7 @@ def method_owner
1515
Kernel
1616
end
1717

18-
def stubbed_instance
18+
def callee
1919
Module.new
2020
end
2121
end

test/acceptance/stub_instance_method_defined_on_module_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def method_owner
77
@method_owner ||= Module.new
88
end
99

10-
def stubbed_instance
10+
def callee
1111
Class.new.send(:include, method_owner).new
1212
end
1313
end

test/acceptance/stub_instance_method_defined_on_object_class_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def method_owner
77
Object
88
end
99

10-
def stubbed_instance
10+
def callee
1111
Class.new.new
1212
end
1313
end

test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ class StubInstanceMethodDefinedOnSingletonClassTest < Mocha::TestCase
44
include StubMethodSharedTests
55

66
def method_owner
7-
stubbed_instance.singleton_class
7+
callee.singleton_class
88
end
99

10-
def stubbed_instance
11-
@stubbed_instance ||= Class.new.new
10+
def callee
11+
@callee ||= Class.new.new
1212
end
1313
end

0 commit comments

Comments
 (0)