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

Fix @backtace typo, add spec

This commit is contained in:
Ryan Fitzgerald 2012-12-27 19:34:52 -08:00
parent e82eaad134
commit 26a4e43a8c
2 changed files with 11 additions and 1 deletions

View file

@ -89,7 +89,7 @@ class Pry
@indent = Pry::Indent.new @indent = Pry::Indent.new
@command_state = {} @command_state = {}
@eval_string = "" @eval_string = ""
@backtace = options[:backtrace] || caller @backtrace = options[:backtrace] || caller
refresh_config(options) refresh_config(options)
push_initial_binding(options) push_initial_binding(options)

View file

@ -428,4 +428,14 @@ describe Pry do
} }
end end
end end
describe "a fresh instance" do
it "should use `caller` as its backtrace" do
location = "#{__FILE__}:#{__LINE__ + 1}"
backtrace = Pry.new.backtrace
backtrace.should.not.be.nil
backtrace.any? { |l| l.include?(location) }.should.be.true
end
end
end end