Permalink
Browse files

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

also remove unnecessary instances of require 'fixture/whereami_helper'
  • Loading branch information...
banister committed Feb 17, 2013
1 parent 4fb8230 commit b1a7da53585f2d325e5d6929f2fd334cbf53c0b6
Showing with 20 additions and 1 deletion.
  1. +20 −1 spec/commands/whereami_spec.rb
@@ -161,8 +161,27 @@ def blimey!
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

0 comments on commit b1a7da5

Please sign in to comment.