diff options
Diffstat (limited to 'spec/ruby/library/tempfile/initialize_spec.rb')
| -rw-r--r-- | spec/ruby/library/tempfile/initialize_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/ruby/library/tempfile/initialize_spec.rb b/spec/ruby/library/tempfile/initialize_spec.rb index 79f33e3e98..0e882a3f0c 100644 --- a/spec/ruby/library/tempfile/initialize_spec.rb +++ b/spec/ruby/library/tempfile/initialize_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' require 'tempfile' describe "Tempfile#initialize" do @@ -12,7 +12,7 @@ describe "Tempfile#initialize" do 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 + File.should.exist?(@tempfile.path) tmpdir = tmp("") path = @tempfile.path @@ -24,11 +24,11 @@ describe "Tempfile#initialize" do end path[0, tmpdir.length].should == tmpdir - path.should include("basename") + path.should.include?("basename") end platform_is_not :windows do - it "sets the permisssions on the tempfile to 0600" do + it "sets the permissions on the tempfile to 0600" do @tempfile.send(:initialize, "basename", tmp("")) File.stat(@tempfile.path).mode.should == 0100600 end @@ -38,4 +38,9 @@ describe "Tempfile#initialize" do @tempfile.send(:initialize, ['shiftjis', 'yml'], encoding: 'SHIFT_JIS') @tempfile.external_encoding.should == Encoding::Shift_JIS end + + it "does not try to modify the arguments" do + @tempfile.send(:initialize, ['frozen'.freeze, 'txt'.freeze], encoding: Encoding::IBM437) + @tempfile.external_encoding.should == Encoding::IBM437 + end end |
