From 02addb1f738e2911b8134c2e522f72079e60aadb Mon Sep 17 00:00:00 2001 From: John Mair Date: Thu, 8 Sep 2011 20:28:08 +1200 Subject: [PATCH] updated tests for view_clip to reflect new behaviour (truncated #<> output) --- lib/pry/default_commands/ls.rb | 2 +- test/test_pry.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/pry/default_commands/ls.rb b/lib/pry/default_commands/ls.rb index 7c3acd6a..159acaae 100644 --- a/lib/pry/default_commands/ls.rb +++ b/lib/pry/default_commands/ls.rb @@ -212,7 +212,7 @@ Shows local and instance variables by default. # plain else list = info.sort_by { |k, v| v.last }.map { |k, v| [k, [v.first.grep(options[:grep])], v.last] } - list = list.each { |k, v| text << text().send(ls_color_map[k], v.first.join(Pry.config.ls.separator)); text << " " } + list = list.each { |k, v| text << text().send(ls_color_map[k], v.first.join(Pry.config.ls.separator)); text << Pry.config.ls.separator } if !options[:f] stagger_output(text) diff --git a/test/test_pry.rb b/test/test_pry.rb index 5f9a957a..b6d19b3c 100644 --- a/test/test_pry.rb +++ b/test/test_pry.rb @@ -1131,7 +1131,7 @@ describe Pry do o = Object.new def o.inspect; "a" * VC_MAX_LENGTH; end - Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x.*?/ + Pry.view_clip(o, VC_MAX_LENGTH).should =~ /# format of the special-cased immediate object if #inspect is longer than maximum" do o = "o" * (VC_MAX_LENGTH + 1) - Pry.view_clip(o, VC_MAX_LENGTH).should =~ /String:0x.*?/ + Pry.view_clip(o, VC_MAX_LENGTH).should =~ /# format" do c, m = Class.new, Module.new - Pry.view_clip(c, VC_MAX_LENGTH).should =~ /Class:0x.*?/ - Pry.view_clip(m, VC_MAX_LENGTH).should =~ /Module:0x.*?/ + Pry.view_clip(c, VC_MAX_LENGTH).should =~ /#