From 36635592919293f10f69076a91b6b0e0ae200455 Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 19 Dec 2012 12:27:10 +0100 Subject: [PATCH] fix tests on ruby 2.0 --- spec/command_integration_spec.rb | 2 +- spec/commands/show_doc_spec.rb | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/spec/command_integration_spec.rb b/spec/command_integration_spec.rb index 7287406f..1b79a594 100644 --- a/spec/command_integration_spec.rb +++ b/spec/command_integration_spec.rb @@ -408,7 +408,7 @@ describe "commands" do it 'should create a command in a nested context and that command should be accessible from the parent' do x = "@x=nil\ncd 7\n_pry_.commands.instance_eval {\ncommand('bing') { |arg| run arg }\n}\ncd ..\nbing ls\nexit-all" redirect_pry_io(StringIO.new("@x=nil\ncd 7\n_pry_.commands.instance_eval {\ncommand('bing') { |arg| run arg }\n}\ncd ..\nbing ls\nexit-all"), @str_output) do - Pry.new.repl(0) + Pry.new.repl('0') end @str_output.string.should =~ /@x/ diff --git a/spec/commands/show_doc_spec.rb b/spec/commands/show_doc_spec.rb index ee2b0679..0d4f89ce 100644 --- a/spec/commands/show_doc_spec.rb +++ b/spec/commands/show_doc_spec.rb @@ -33,7 +33,12 @@ if !PryTestHelpers.mri18_and_no_real_source_location? end it "should be able to find super methods" do - c = Class.new{ + b = Class.new{ + # daddy initialize! + def initialize(*args) ;end + } + + c = Class.new(b){ # classy initialize! def initialize(*args); end } @@ -53,13 +58,7 @@ if !PryTestHelpers.mri18_and_no_real_source_location? t.eval("show-doc o.initialize").should =~ /instancey initialize/ t.eval("show-doc --super o.initialize").should =~ /grungy initialize/ t.eval("show-doc o.initialize -ss").should =~ /classy initialize/ - - begin - require 'pry-doc' - t.eval("show-doc --super o.initialize -ss").should == - t.eval("show-doc Object#initialize") - rescue LoadError - end + t.eval("show-doc o.initialize -sss").should =~ /daddy initialize/ end describe "rdoc highlighting" do