1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Paul Chechetin 2013-04-16 19:25:33 +04:00
parent c316d76c06
commit 9a3793d1a1
2 changed files with 19 additions and 1 deletions

View file

@ -267,7 +267,7 @@ class Pry
end
def format_variables(type, vars)
vars.sort_by(&:downcase).map{ |var| color(type, var) }
vars.sort_by{ |var| var.to_s.downcase }.map{ |var| color(type, var) }
end
def format_constants(mod, constants)

View file

@ -60,6 +60,24 @@ describe "ls" do
pry_eval("ls Net::HTTP::Get.new('localhost')").should =~ /Net::HTTPGenericRequest#methods/
end
it "should work for objects which instance_variables returns array of symbol but there is no Symbol#downcase" do
test_case = "class Object; alias :fg :instance_variables; def instance_variables; fg.map(&:to_sym); end end;"
normalize = "class Object; def instance_variables; fg; end end;"
test = lambda do
begin
pry_eval(test_case, "class GeFromulate2; @flurb=1.3; end", "cd GeFromulate2", "ls")
pry_eval(normalize)
rescue
pry_eval(normalize)
raise
end
end
test.should.not.raise
end
# see: https://travis-ci.org/pry/pry/jobs/5071918
unless Pry::Helpers::BaseHelpers.rbx?
it "should handle classes that (pathologically) define .ancestors" do