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:
parent
4fb8230aca
commit
b1a7da5358
1 changed files with 20 additions and 1 deletions
|
@ -161,8 +161,27 @@ describe "whereami" do
|
||||||
Object.remove_const(:Cor)
|
Object.remove_const(:Cor)
|
||||||
end
|
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
|
it 'should show class when -c option used, and binding is outside a method' do
|
||||||
require 'fixtures/whereami_helper'
|
|
||||||
class Cor
|
class Cor
|
||||||
def blimey;end
|
def blimey;end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue