 -  # -256, -2 and -1 raise Errno::EINVAL on OpenBSD
 -  platform_is :freebsd, :openbsd, :darwin do
 -    it "always succeeds with any numeric values" do
--      vals = [#-2**30, -2**16, -2**8, -2, -1,
--        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8]#, 2**16, 2**30
+-      vals = [#-2**30, -2**16, -256, -2, -1,
+-        -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 256]#, 2**16, 2**30
 -      vals.each { |v|
 -        lambda { @file.chmod(v) }.should_not raise_error
 -      }

+FILE_VALS = 
+  if PlatformGuard.new(:netbsd).match?
+    # -256, -2 and -1 raise Errno::EFTYPE on NetBSD
+    [-2**30, -2**16,               -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+  elsif PlatformGuard.new(:freebsd, :openbsd, :darwin).match?
+    # -256, -2 and -1 raise Errno::EINVAL on OpenBSD
+    [                              -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8]
+  elsif PlatformGuard.new(:mingw).match?
+    [        -2**15, -2**8, -2, -1,-0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**15]
+  else
+    [-2**30, -2**16, -2**8, -2, -1,-0.5, 0, 1, 2, 5.555575, 16, 32, 64, 2**8, 2**16, 2**30]
+  end
+
 describe "File.umask" do
   before :each do
     @orig_umask = File.umask
@@ -30,31 +44,10 @@
     end
   end
 
-  platform_is_not :freebsd, :darwin do
-    it "always succeeds with any integer values" do
-      vals = [-2**30, -2**16, -2**8, -2,
-              -1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8, 2**16, 2**30]
-      vals.each { |v|
-        lambda { File.umask(v) }.should_not raise_error
-      }
-    end
-  end
-
-  platform_is :freebsd, :darwin do
-    it "always succeeds with any integer values" do
-      vals = [-2**8, -2,
-              -1.5, -1, 0.5, 0, 1, 2, 7.77777, 16, 32, 64, 2**8]
-      vals.each { |v|
-        lambda { File.umask(v) }.should_not raise_error
-      }
-    end
-
-    it "fails with invalid values" do
-      vals = [-2**30, -2**16, 2**16, 2**30]
-      vals.each { |v|
-        lambda { File.chmod(v, @file) }.should raise_error(RangeError)
-      }
-    end
+  it "always succeeds with any integer values" do

+FILE_VALS = 
+  if PlatformGuard.new(:netbsd).match?
+    # -256, -2 and -1 raise Errno::EFTYPE on NetBSD
+    [-2**30, -2**16,              -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 256, 2**16, 2**30]
+  elsif PlatformGuard.new(:freebsd, :openbsd, :darwin).match?
+    # -256, -2 and -1 raise Errno::EINVAL on OpenBSD
+    [                             -0.5, 0, 1, 2, 5.555575, 16, 32, 64, 256]
+  elsif PlatformGuard.new(:mingw).match?
+    [        -2**15, -256, -2, -1,-0.5, 0, 1, 2, 5.555575, 16, 32, 64, 256, 2**15]
+  else
+    [-2**30, -2**16, -256, -2, -1,-0.5, 0, 1, 2, 5.555575, 16, 32, 64, 256, 2**16, 2**30]
+  end
+
 describe "File#chmod" do
