You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rubygem-pry/rubygem-pry-0.10.1-Rename-h...

62 lines
3.1 KiB

From 0807328bcfd1585b0f668c269dd232505fab8a2c Mon Sep 17 00:00:00 2001
From: John Mair <jrmair@gmail.com>
Date: Mon, 16 Feb 2015 21:10:00 +0100
Subject: [PATCH] Rename helper spec: singleton_class(arg) -> eigenclass(arg)
It was causing the most ridiculous non-sensical test failures, possibly a bug in Ruby itself, but this patch fixes it
---
spec/method_spec.rb | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/spec/method_spec.rb b/spec/method_spec.rb
index 980c555..8e38b6d 100644
--- a/spec/method_spec.rb
+++ b/spec/method_spec.rb
@@ -389,7 +389,7 @@ class Lower < Low; extend N; end
class Bottom < Lower; extend O; end
end
- def singleton_class(obj); class << obj; self; end; end
+ def eigen_class(obj); class << obj; self; end; end
it "should look at a class and then its superclass" do
Pry::Method.instance_resolution_order(LS::Next).should == [LS::Next] + Pry::Method.instance_resolution_order(LS::Top)
@@ -409,7 +409,7 @@ def singleton_class(obj); class << obj; self; end; end
it "should include the singleton class of objects" do
obj = LS::Low.new
- Pry::Method.resolution_order(obj).should == [singleton_class(obj)] + Pry::Method.instance_resolution_order(LS::Low)
+ Pry::Method.resolution_order(obj).should == [eigen_class(obj)] + Pry::Method.instance_resolution_order(LS::Low)
end
it "should not include singleton classes of numbers" do
@@ -417,11 +417,11 @@ def singleton_class(obj); class << obj; self; end; end
end
it "should include singleton classes for classes" do
- Pry::Method.resolution_order(LS::Low).should == [singleton_class(LS::Low)] + Pry::Method.resolution_order(LS::Next)
+ Pry::Method.resolution_order(LS::Low).should == [eigen_class(LS::Low)] + Pry::Method.resolution_order(LS::Next)
end
it "should include modules included into singleton classes" do
- Pry::Method.resolution_order(LS::Lower).should == [singleton_class(LS::Lower), LS::N, LS::M] + Pry::Method.resolution_order(LS::Low)
+ Pry::Method.resolution_order(LS::Lower).should == [eigen_class(LS::Lower), LS::N, LS::M] + Pry::Method.resolution_order(LS::Low)
end
it "should include modules at most once" do
@@ -429,12 +429,12 @@ def singleton_class(obj); class << obj; self; end; end
end
it "should include modules at the point which they would be reached" do
- Pry::Method.resolution_order(LS::Bottom).should == [singleton_class(LS::Bottom), LS::O] + (Pry::Method.resolution_order(LS::Lower))
+ Pry::Method.resolution_order(LS::Bottom).should == [eigen_class(LS::Bottom), LS::O] + (Pry::Method.resolution_order(LS::Lower))
end
it "should include the Pry::Method.instance_resolution_order of Class after the singleton classes" do
Pry::Method.resolution_order(LS::Top).should ==
- [singleton_class(LS::Top), singleton_class(Object), singleton_class(BasicObject),
+ [eigen_class(LS::Top), eigen_class(Object), eigen_class(BasicObject),
*Pry::Method.instance_resolution_order(Class)]
end
end