1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

try to fix tests

This commit is contained in:
John Mair 2012-07-02 03:49:01 +12:00
parent 743326faee
commit 7001a357aa
2 changed files with 13 additions and 12 deletions

View file

@ -250,7 +250,7 @@ if !mri18_and_no_real_source_location?
describe "when no class/module arg is given" do
before do
module Host
module TestHost
# hello there froggy
module M
@ -261,12 +261,12 @@ if !mri18_and_no_real_source_location?
end
after do
Object.remove_const(:Host)
Object.remove_const(:TestHost)
end
it 'should return doc for current module' do
redirect_pry_io(InputTester.new("show-doc"), out = StringIO.new) do
Pry.start(Host::M)
Pry.start(TestHost::M)
end
out.string.should =~ /hello there froggy/
@ -277,7 +277,7 @@ if !mri18_and_no_real_source_location?
describe "should skip over broken modules" do
before do
module Host
module TestHost
# hello
module M
@ -295,11 +295,11 @@ if !mri18_and_no_real_source_location?
end
after do
Object.remove_const(:Host)
Object.remove_const(:TestHost)
end
it 'should return doc for first valid module' do
redirect_pry_io(InputTester.new("show-doc Host::M"), out = StringIO.new) do
redirect_pry_io(InputTester.new("show-doc TestHost::M"), out = StringIO.new) do
Pry.start
end

View file

@ -393,17 +393,17 @@ if !mri18_and_no_real_source_location?
out.string.should =~ /\d:\s*def beta/
end
describe "should skip over broken modules" do
describe "should skip over broken modules" do
before do
module Host
module BabyDuck
module M
module Muesli
binding.eval("def a; end", "dummy.rb", 1)
binding.eval("def b; end", "dummy.rb", 2)
binding.eval("def c; end", "dummy.rb", 3)
end
module M
module Muesli
def d; end
def e; end
end
@ -411,11 +411,11 @@ if !mri18_and_no_real_source_location?
end
after do
Object.remove_const(:Host)
Object.remove_const(:BabyDuck)
end
it 'should return source for first valid module' do
redirect_pry_io(InputTester.new("show-source Host::M"), out = StringIO.new) do
redirect_pry_io(InputTester.new("show-source BabyDuck::Muesli"), out = StringIO.new) do
Pry.start
end
@ -429,3 +429,4 @@ if !mri18_and_no_real_source_location?
end
end
end