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:
parent
e82eaad134
commit
26a4e43a8c
2 changed files with 11 additions and 1 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue