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

Ask Tempfile to unlink when we Tempfile#close.

Fixes: #375
Signed-off-by: Jordon Bedwell <jordon@envygeeks.com>
This commit is contained in:
Jordon Bedwell 2011-12-26 07:29:23 -06:00
parent 37b5757502
commit f5a01141ea
4 changed files with 9 additions and 7 deletions

View file

@ -25,7 +25,7 @@ class Pry
file = Tempfile.new(['pry', '.rb'])
yield file
ensure
file.close
file.close(true)
end
def get_method_or_raise(name, target, opts={}, omit_help=false)

View file

@ -167,7 +167,7 @@ def temp_file
file = Tempfile.new('pry')
yield file
ensure
file.close
file.close(true)
end

View file

@ -53,7 +53,7 @@ describe "Pry::DefaultCommands::Introspection" do
mock_pry("edit #{path}", "$rand").should =~ /#{@rand}/
tf.close
tf.close(true)
end
it "should not reload the file if it is not a ruby file" do
@ -62,7 +62,7 @@ describe "Pry::DefaultCommands::Introspection" do
mock_pry("edit #{path}", "$rand").should.not =~ /#{@rand}/
tf.close
tf.close(true)
end
it "should not reload a ruby file if -n is given" do
@ -71,7 +71,7 @@ describe "Pry::DefaultCommands::Introspection" do
mock_pry("edit -n #{path}", "$rand").should.not =~ /#{@rand}/
tf.close
tf.close(true)
end
it "should reload a non-ruby file if -r is given" do
@ -80,7 +80,7 @@ describe "Pry::DefaultCommands::Introspection" do
mock_pry("edit -r #{path}", "$rand").should =~ /#{@rand}/
tf.close
tf.close(true)
end
end
end

View file

@ -140,7 +140,9 @@ describe "Pry::DefaultCommands::Shell" do
pry_instance.rep(self)
str_output.string.should =~ /bt number 0/
temp_files.each(&:close)
temp_files.each do |file|
file.close(true)
end
end
end