File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,22 @@ describe SystemError do
22
22
error.os_error.should eq Errno ::ENOENT
23
23
end
24
24
end
25
+
26
+ {% if flag?(:win32 ) % }
27
+ describe " .from_winerror" do
28
+ it " avoid reset from message" do
29
+ WinError .value = :ERROR_FILE_NOT_FOUND
30
+ error = ::RuntimeError .from_winerror(message: " foobar" .tap { WinError .value = :ERROR_ACCESS_DENIED })
31
+ error.os_error.should eq WinError ::ERROR_ACCESS_DENIED # This should be ERROR_FILE_NOT_FOUND
32
+ end
33
+ end
34
+
35
+ describe " .from_wsa_error" do
36
+ it " avoid reset from message" do
37
+ WinError .wsa_value = :ERROR_FILE_NOT_FOUND
38
+ error = ::RuntimeError .from_wsa_error(message: " foobar" .tap { WinError .wsa_value = :ERROR_ACCESS_DENIED })
39
+ error.os_error.should eq WinError ::ERROR_ACCESS_DENIED # This should be ERROR_FILE_NOT_FOUND
40
+ end
41
+ end
42
+ {% end % }
25
43
end
You can’t perform that action at this time.
0 commit comments