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

whereami -c: Add test to ensure correct superclass is located

also remove unnecessary instances of require 'fixture/whereami_helper'
This commit is contained in:
John Mair 2013-02-17 20:20:37 +01:00
parent 4fb8230aca
commit b1a7da5358

View file

@ -161,8 +161,27 @@ describe "whereami" do
Object.remove_const(:Cor)
end
it 'should show class when -c option used, and locate correct superclass' do
class Cor
def blimey!
1
2
out = pry_eval(binding, 'whereami -c')
out.should =~ /class Cor/
out.should =~ /blimey/
end
end
class Horse < Cor
def pig;end
end
Horse.new.blimey!
Object.remove_const(:Cor)
Object.remove_const(:Horse)
end
it 'should show class when -c option used, and binding is outside a method' do
require 'fixtures/whereami_helper'
class Cor
def blimey;end