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

Fix reload-code specs [Fixes #1224]

The cascading problem was caused by reloading sensitive bits of bacon
This commit is contained in:
Conrad Irwin 2014-05-07 00:59:36 -07:00
parent 4385b94488
commit ed58b9716a

View file

@ -4,9 +4,10 @@ describe "reload_code" do
describe "reload_current_file" do
it 'raises an error source code not found' do
proc do
pry_eval(
"reload-code")
end.should.raise(Pry::CommandError).message.should =~ /cannot be found on disk!/
eval <<-RUBY, TOPLEVEL_BINDING, 'does_not_exist.rb', 1
pry_eval(binding, "reload-code")
RUBY
end.should.raise(Pry::CommandError)
end
it 'raises an error when class not found' do
@ -14,7 +15,7 @@ describe "reload_code" do
pry_eval(
"cd Class.new(Class.new{ def goo; end; public :goo })",
"reload-code")
end.should.raise(Pry::CommandError).message.should =~ /Cannot locate self/
end.should.raise(Pry::CommandError)
end
end
end