Include errno name in error messages, if the errno is known.

This commit is contained in:
Adam Murdoch
2013-02-16 11:14:41 +11:00
parent 0c5d0dfe80
commit 01c4f26e97
7 changed files with 26 additions and 13 deletions

View File

@@ -53,7 +53,7 @@ class PosixFileTest extends Specification {
then:
NativeException e = thrown()
e.message == "Could not set UNIX mode on $testFile: could not chmod file (errno 2)"
e.message == "Could not set UNIX mode on $testFile: could not chmod file (ENOENT errno 2)"
}
def "cannot get mode on file that does not exist"() {
@@ -64,7 +64,7 @@ class PosixFileTest extends Specification {
then:
NativeException e = thrown()
e.message == "Could not get UNIX mode on $testFile: could not stat file (errno 2)"
e.message == "Could not get UNIX mode on $testFile: could not stat file (ENOENT errno 2)"
}
def "can create symbolic link"() {
@@ -99,7 +99,7 @@ class PosixFileTest extends Specification {
then:
NativeException e = thrown()
e.message == "Could not read symlink $symlinkFile: could not lstat file (errno 2)"
e.message == "Could not read symlink $symlinkFile: could not lstat file (ENOENT errno 2)"
}
def "cannot read a symlink that is not a symlink"() {