diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-06-27 21:02:36 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-06-27 21:02:36 +0200 |
commit | d80e44deec77678fe2d72f94c17b2409b3e794d5 (patch) | |
tree | 612bf2313550e0982dda452f48492cc069e1c21a /spec/ruby/core/file | |
parent | c940397116c5aef76b1c0d05561c11d43ef596a7 (diff) | |
download | ruby-d80e44deec77678fe2d72f94c17b2409b3e794d5.tar.gz |
Update to ruby/spec@8d74d49
Diffstat (limited to 'spec/ruby/core/file')
-rw-r--r-- | spec/ruby/core/file/chown_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/core/file/expand_path_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/file/fixtures/file_types.rb | 13 | ||||
-rw-r--r-- | spec/ruby/core/file/initialize_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/lchown_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/open_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/ftype_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/setgid_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/setuid_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/socket_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/file/stat/sticky_spec.rb | 4 |
11 files changed, 10 insertions, 51 deletions
diff --git a/spec/ruby/core/file/chown_spec.rb b/spec/ruby/core/file/chown_spec.rb index 8660534825..512d5b4738 100644 --- a/spec/ruby/core/file/chown_spec.rb +++ b/spec/ruby/core/file/chown_spec.rb @@ -142,11 +142,3 @@ describe "File#chown" do @file.chown(nil, nil).should == 0 end end - -describe "File.chown" do - it "needs to be reviewed for spec completeness" -end - -describe "File#chown" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb index 1d972023a3..aa6a3c9c63 100644 --- a/spec/ruby/core/file/expand_path_spec.rb +++ b/spec/ruby/core/file/expand_path_spec.rb @@ -141,12 +141,12 @@ describe "File.expand_path" do File.expand_path(path).encoding.should equal(Encoding::CP1251) weird_path = [222, 173, 190, 175].pack('C*') - File.expand_path(weird_path).encoding.should equal(Encoding::ASCII_8BIT) + File.expand_path(weird_path).encoding.should equal(Encoding::BINARY) end platform_is_not :windows do - it "expands a path when the default external encoding is ASCII-8BIT" do - Encoding.default_external = Encoding::ASCII_8BIT + it "expands a path when the default external encoding is BINARY" do + Encoding.default_external = Encoding::BINARY path_8bit = [222, 173, 190, 175].pack('C*') File.expand_path( path_8bit, @rootdir).should == "#{@rootdir}" + path_8bit end diff --git a/spec/ruby/core/file/fixtures/file_types.rb b/spec/ruby/core/file/fixtures/file_types.rb index 1dd0752f73..109bcfe42e 100644 --- a/spec/ruby/core/file/fixtures/file_types.rb +++ b/spec/ruby/core/file/fixtures/file_types.rb @@ -52,15 +52,10 @@ module FileSpecs end def self.socket - require 'socket' - name = tmp("ftype_socket.socket") - rm_r name - begin - socket = UNIXServer.new name - rescue ArgumentError => error - error.message.should =~ /too long/ - return - end + require_relative '../../../library/socket/fixtures/classes.rb' + + name = SocketSpecs.socket_path + socket = UNIXServer.new name begin yield name ensure diff --git a/spec/ruby/core/file/initialize_spec.rb b/spec/ruby/core/file/initialize_spec.rb index 00e2228031..9a76a95260 100644 --- a/spec/ruby/core/file/initialize_spec.rb +++ b/spec/ruby/core/file/initialize_spec.rb @@ -1,10 +1,6 @@ require_relative '../../spec_helper' describe "File#initialize" do - it "needs to be reviewed for spec completeness" -end - -describe "File#initialize" do after :each do @io.close if @io end diff --git a/spec/ruby/core/file/lchown_spec.rb b/spec/ruby/core/file/lchown_spec.rb index 7889d68559..8d95d287ba 100644 --- a/spec/ruby/core/file/lchown_spec.rb +++ b/spec/ruby/core/file/lchown_spec.rb @@ -57,7 +57,3 @@ as_superuser do end end end - -describe "File.lchown" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/ruby/core/file/open_spec.rb b/spec/ruby/core/file/open_spec.rb index 14be5aa32a..59c13f08ed 100644 --- a/spec/ruby/core/file/open_spec.rb +++ b/spec/ruby/core/file/open_spec.rb @@ -552,9 +552,9 @@ describe "File.open" do lambda { File.open(@file, 'fake') }.should raise_error(ArgumentError) end - it "defaults external_encoding to ASCII-8BIT for binary modes" do - File.open(@file, 'rb') {|f| f.external_encoding.should == Encoding::ASCII_8BIT} - File.open(@file, 'wb+') {|f| f.external_encoding.should == Encoding::ASCII_8BIT} + it "defaults external_encoding to BINARY for binary modes" do + File.open(@file, 'rb') {|f| f.external_encoding.should == Encoding::BINARY} + File.open(@file, 'wb+') {|f| f.external_encoding.should == Encoding::BINARY} end it "uses the second argument as an options Hash" do diff --git a/spec/ruby/core/file/stat/ftype_spec.rb b/spec/ruby/core/file/stat/ftype_spec.rb index a19e7c43d7..eb892eae5f 100644 --- a/spec/ruby/core/file/stat/ftype_spec.rb +++ b/spec/ruby/core/file/stat/ftype_spec.rb @@ -55,10 +55,6 @@ describe "File::Stat#ftype" do end end - # This will silently not execute the block if no socket - # can be found. However, if you are running X, there is - # a good chance that if nothing else, at least the X - # Server socket exists. it "returns 'socket' when the file is a socket" do FileSpecs.socket do |socket| File.lstat(socket).ftype.should == 'socket' diff --git a/spec/ruby/core/file/stat/setgid_spec.rb b/spec/ruby/core/file/stat/setgid_spec.rb index 9b972f5a6d..c0748ede57 100644 --- a/spec/ruby/core/file/stat/setgid_spec.rb +++ b/spec/ruby/core/file/stat/setgid_spec.rb @@ -5,7 +5,3 @@ require_relative 'fixtures/classes' describe "File::Stat#setgid?" do it_behaves_like :file_setgid, :setgid?, FileStat end - -describe "File::Stat#setgid?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/ruby/core/file/stat/setuid_spec.rb b/spec/ruby/core/file/stat/setuid_spec.rb index 892776a0ef..6408120fc4 100644 --- a/spec/ruby/core/file/stat/setuid_spec.rb +++ b/spec/ruby/core/file/stat/setuid_spec.rb @@ -5,7 +5,3 @@ require_relative 'fixtures/classes' describe "File::Stat#setuid?" do it_behaves_like :file_setuid, :setuid?, FileStat end - -describe "File::Stat#setuid?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/ruby/core/file/stat/socket_spec.rb b/spec/ruby/core/file/stat/socket_spec.rb index 8dd43ec44a..09740be110 100644 --- a/spec/ruby/core/file/stat/socket_spec.rb +++ b/spec/ruby/core/file/stat/socket_spec.rb @@ -5,7 +5,3 @@ require_relative 'fixtures/classes' describe "File::Stat#socket?" do it_behaves_like :file_socket, :socket?, FileStat end - -describe "File::Stat#socket?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/ruby/core/file/stat/sticky_spec.rb b/spec/ruby/core/file/stat/sticky_spec.rb index 8634253a02..7083e644e9 100644 --- a/spec/ruby/core/file/stat/sticky_spec.rb +++ b/spec/ruby/core/file/stat/sticky_spec.rb @@ -5,7 +5,3 @@ require_relative 'fixtures/classes' describe "File::Stat#sticky?" do it_behaves_like :file_sticky, :sticky?, FileStat end - -describe "File::Stat#sticky?" do - it "needs to be reviewed for spec completeness" -end |