Permalink
Browse files

Use more conventional naming for test samples :)

  • Loading branch information...
1 parent cf2224f commit 56b73404d49d9b5e838836c425d81d06a6920287 @altitude-xx altitude-xx committed Dec 15, 2011
Showing with 20 additions and 20 deletions.
  1. +20 −20 test/method_proxy_test.rb
View
@@ -1,4 +1,4 @@
-class LabRabbit
+class GuineaPig
def lr_instance_method a, b
return "#{a}-#{b}"
end
@@ -13,41 +13,41 @@ def self.lr_class_method c, d
class MethodProxyTest < Test::Unit::TestCase
def test_proxy_unproxy_instance_method
- lrabbit = LabRabbit.new
- assert_equal "2-3", lrabbit.lr_instance_method(2, 3)
+ gpig = GuineaPig.new
+ assert_equal "2-3", gpig.lr_instance_method(2, 3)
assert [].eql?(MethodProxy.classes_with_proxied_instance_methods)
- assert_equal [], MethodProxy.proxied_instance_methods_for(LabRabbit)
+ assert_equal [], MethodProxy.proxied_instance_methods_for(GuineaPig)
- MethodProxy.proxy_instance_method(LabRabbit, :lr_instance_method) do |obj, meth, a, b|
+ MethodProxy.proxy_instance_method(GuineaPig, :lr_instance_method) do |obj, meth, a, b|
res = meth.call a, b
next "<#{res}>" # within Proc's should be 'next' instead of 'return' -- in order to avoid returning from the caller method
end
- assert_equal "<2-3>", lrabbit.lr_instance_method(2, 3)
- assert [LabRabbit].eql?(MethodProxy.classes_with_proxied_instance_methods)
- assert_equal [:lr_instance_method], MethodProxy.proxied_instance_methods_for(LabRabbit)
+ assert_equal "<2-3>", gpig.lr_instance_method(2, 3)
+ assert [GuineaPig].eql?(MethodProxy.classes_with_proxied_instance_methods)
+ assert_equal [:lr_instance_method], MethodProxy.proxied_instance_methods_for(GuineaPig)
- MethodProxy.unproxy_instance_method(LabRabbit, :lr_instance_method)
- assert_equal "2-3", lrabbit.lr_instance_method(2, 3)
+ MethodProxy.unproxy_instance_method(GuineaPig, :lr_instance_method)
+ assert_equal "2-3", gpig.lr_instance_method(2, 3)
assert [].eql?(MethodProxy.classes_with_proxied_instance_methods)
- assert_equal [], MethodProxy.proxied_instance_methods_for(LabRabbit)
+ assert_equal [], MethodProxy.proxied_instance_methods_for(GuineaPig)
end
def test_proxy_unproxy_class_method
- assert_equal "4$5", LabRabbit.lr_class_method(4, 5)
+ assert_equal "4$5", GuineaPig.lr_class_method(4, 5)
assert [].eql?(MethodProxy.classes_with_proxied_class_methods)
- assert_equal [], MethodProxy.proxied_class_methods_for(LabRabbit)
+ assert_equal [], MethodProxy.proxied_class_methods_for(GuineaPig)
- MethodProxy.proxy_class_method(LabRabbit, :lr_class_method) do |obj, meth, c, d|
+ MethodProxy.proxy_class_method(GuineaPig, :lr_class_method) do |obj, meth, c, d|
res = meth.call c, d
next "[#{res}]" # within Proc's should be 'next' instead of 'return' -- in order to avoid returning from the caller method
end
- assert_equal "[4$5]", LabRabbit.lr_class_method(4, 5)
- assert [LabRabbit].eql?(MethodProxy.classes_with_proxied_class_methods)
- assert_equal [:lr_class_method], MethodProxy.proxied_class_methods_for(LabRabbit)
+ assert_equal "[4$5]", GuineaPig.lr_class_method(4, 5)
+ assert [GuineaPig].eql?(MethodProxy.classes_with_proxied_class_methods)
+ assert_equal [:lr_class_method], MethodProxy.proxied_class_methods_for(GuineaPig)
- MethodProxy.unproxy_class_method(LabRabbit, :lr_class_method)
- assert_equal "4$5", LabRabbit.lr_class_method(4, 5)
+ MethodProxy.unproxy_class_method(GuineaPig, :lr_class_method)
+ assert_equal "4$5", GuineaPig.lr_class_method(4, 5)
assert [].eql?(MethodProxy.classes_with_proxied_class_methods)
- assert_equal [], MethodProxy.proxied_class_methods_for(LabRabbit)
+ assert_equal [], MethodProxy.proxied_class_methods_for(GuineaPig)
end
end

0 comments on commit 56b7340

Please sign in to comment.