summaryrefslogtreecommitdiff
path: root/spec/ruby/library/tempfile/delete_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/tempfile/delete_spec.rb')
-rw-r--r--spec/ruby/library/tempfile/delete_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/ruby/library/tempfile/delete_spec.rb b/spec/ruby/library/tempfile/delete_spec.rb
index 8e92631e62..b126ceae6a 100644
--- a/spec/ruby/library/tempfile/delete_spec.rb
+++ b/spec/ruby/library/tempfile/delete_spec.rb
@@ -1,7 +1,15 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/unlink', __FILE__)
+require_relative '../../spec_helper'
require 'tempfile'
describe "Tempfile#delete" do
- it_behaves_like :tempfile_unlink, :delete
+ before :each do
+ @tempfile = Tempfile.new("specs")
+ end
+
+ it "unlinks self" do
+ @tempfile.close
+ path = @tempfile.path
+ @tempfile.delete
+ File.should_not.exist?(path)
+ end
end