mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
21 lines
566 B
Ruby
21 lines
566 B
Ruby
|
require_relative '../helper'
|
||
|
|
||
|
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!/
|
||
|
end
|
||
|
|
||
|
it 'raises an error when class not found' do
|
||
|
proc 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
|
||
|
end
|
||
|
end
|