Permalink
Browse files

updated tests for view_clip to reflect new behaviour (truncated #<> o…

…utput)
  • Loading branch information...
1 parent 1759f28 commit 02addb1f738e2911b8134c2e522f72079e60aadb @banister banister committed Sep 8, 2011
Showing with 9 additions and 9 deletions.
  1. +1 −1 lib/pry/default_commands/ls.rb
  2. +8 −8 test/test_pry.rb
@@ -212,7 +212,7 @@ def ls_color_map
# 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)
View
@@ -1131,7 +1131,7 @@ def readline(*args)
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 =~ /#<Object/
end
end
@@ -1152,7 +1152,7 @@ def o.inspect; "a" * VC_MAX_LENGTH; end
# only testing with String here :)
it "returns #<> 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 =~ /#<String/
end
end
@@ -1161,7 +1161,7 @@ def o.inspect; "a" * VC_MAX_LENGTH; end
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 =~ /#<Object/
end
end
@@ -1172,7 +1172,7 @@ def o.inspect; "a" * VC_MAX_LENGTH; end
o = Object.new
def o.inspect; "a" * (VC_MAX_LENGTH + 1); end
- Pry.view_clip(o, VC_MAX_LENGTH).should =~ /Object:0x.*?/
+ Pry.view_clip(o, VC_MAX_LENGTH).should =~ /#<Object/
end
end
@@ -1181,8 +1181,8 @@ def o.inspect; "a" * (VC_MAX_LENGTH + 1); end
it "returns a string of the #<class name:object idish> 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 =~ /#<Class/
+ Pry.view_clip(m, VC_MAX_LENGTH).should =~ /#<Module/
end
end
@@ -1194,8 +1194,8 @@ def o.inspect; "a" * (VC_MAX_LENGTH + 1); end
def c.name; "a" * (VC_MAX_LENGTH + 1); end
def m.name; "a" * (VC_MAX_LENGTH + 1); end
- 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 =~ /#<Class/
+ Pry.view_clip(m, VC_MAX_LENGTH).should =~ /#<Module/
end
end

0 comments on commit 02addb1

Please sign in to comment.