summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/tempfile/initialize_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/tempfile/initialize_spec.rb')
-rw-r--r--spec/rubyspec/library/tempfile/initialize_spec.rb41
1 files changed, 0 insertions, 41 deletions
diff --git a/spec/rubyspec/library/tempfile/initialize_spec.rb b/spec/rubyspec/library/tempfile/initialize_spec.rb
deleted file mode 100644
index 79f33e3e98..0000000000
--- a/spec/rubyspec/library/tempfile/initialize_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'tempfile'
-
-describe "Tempfile#initialize" do
- before :each do
- @tempfile = Tempfile.allocate
- end
-
- after :each do
- @tempfile.close!
- end
-
- it "opens a new tempfile with the passed name in the passed directory" do
- @tempfile.send(:initialize, "basename", tmp(""))
- File.exist?(@tempfile.path).should be_true
-
- tmpdir = tmp("")
- path = @tempfile.path
-
- platform_is :windows do
- # on Windows, both types of slashes are OK,
- # but the tmp helper always uses '/'
- path.gsub!('\\', '/')
- end
-
- path[0, tmpdir.length].should == tmpdir
- path.should include("basename")
- end
-
- platform_is_not :windows do
- it "sets the permisssions on the tempfile to 0600" do
- @tempfile.send(:initialize, "basename", tmp(""))
- File.stat(@tempfile.path).mode.should == 0100600
- end
- end
-
- it "accepts encoding options" do
- @tempfile.send(:initialize, ['shiftjis', 'yml'], encoding: 'SHIFT_JIS')
- @tempfile.external_encoding.should == Encoding::Shift_JIS
- end
-end