diff options
Diffstat (limited to 'spec/ruby/core/file/expand_path_spec.rb')
| -rw-r--r-- | spec/ruby/core/file/expand_path_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb index 1abcf93900..160494f145 100644 --- a/spec/ruby/core/file/expand_path_spec.rb +++ b/spec/ruby/core/file/expand_path_spec.rb @@ -92,7 +92,7 @@ describe "File.expand_path" do end it "raises an ArgumentError if the path is not valid" do - -> { File.expand_path("~a_not_existing_user") }.should raise_error(ArgumentError) + -> { File.expand_path("~a_not_existing_user") }.should.raise(ArgumentError) end it "expands ~ENV['USER'] to the user's home directory" do @@ -117,9 +117,9 @@ describe "File.expand_path" do end it "raises a TypeError if not passed a String type" do - -> { File.expand_path(1) }.should raise_error(TypeError) - -> { File.expand_path(nil) }.should raise_error(TypeError) - -> { File.expand_path(true) }.should raise_error(TypeError) + -> { File.expand_path(1) }.should.raise(TypeError) + -> { File.expand_path(nil) }.should.raise(TypeError) + -> { File.expand_path(true) }.should.raise(TypeError) end platform_is_not :windows do @@ -138,10 +138,10 @@ describe "File.expand_path" do Encoding.default_external = Encoding::SHIFT_JIS path = "./a".dup.force_encoding Encoding::CP1251 - File.expand_path(path).encoding.should equal(Encoding::CP1251) + 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::BINARY) + File.expand_path(weird_path).encoding.should.equal?(Encoding::BINARY) end platform_is_not :windows do @@ -159,7 +159,7 @@ describe "File.expand_path" do platform_is_not :windows do it "raises an Encoding::CompatibilityError if the external encoding is not compatible" do Encoding.default_external = Encoding::UTF_16BE - -> { File.expand_path("./a") }.should raise_error(Encoding::CompatibilityError) + -> { File.expand_path("./a") }.should.raise(Encoding::CompatibilityError) end end @@ -179,7 +179,7 @@ describe "File.expand_path" do str = FileSpecs::SubString.new "./a/b/../c" path = File.expand_path(str, @base) path.should == "#{@base}/a/c" - path.should be_an_instance_of(String) + path.should.instance_of?(String) end end @@ -244,7 +244,7 @@ platform_is_not :windows do it "raises an ArgumentError when passed '~' if HOME == ''" do ENV["HOME"] = "" - -> { File.expand_path("~") }.should raise_error(ArgumentError) + -> { File.expand_path("~") }.should.raise(ArgumentError) end end @@ -259,7 +259,7 @@ platform_is_not :windows do it "raises an ArgumentError" do ENV["HOME"] = "non-absolute" - -> { File.expand_path("~") }.should raise_error(ArgumentError, 'non-absolute home') + -> { File.expand_path("~") }.should.raise(ArgumentError, 'non-absolute home') end end end |
