Skip to content

Commit 6efeebe

Browse files
committed
Change publicity test for Windows
1 parent 4e8c63d commit 6efeebe

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

library/tempfile/create_spec.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@
3030
@tempfile.gets.should == "Test!\n"
3131
end
3232

33-
it "returns a private file" do
34-
@tempfile = Tempfile.create
35-
@tempfile.stat.mode.to_s(8).should.end_with?("600")
33+
platform_is_not :windows do
34+
it "returns a private file" do
35+
@tempfile = Tempfile.create
36+
@tempfile.stat.mode.to_s(8).should.end_with?("600")
37+
end
38+
end
39+
40+
platform_is :windows do
41+
it "returns a public file" do
42+
@tempfile = Tempfile.create
43+
@tempfile.stat.mode.to_s(8).should.end_with?("666")
44+
end
3645
end
3746

3847
context "when called with a block" do
@@ -99,8 +108,8 @@
99108
File.writable?(@tempfile.path).should be_true
100109
end
101110

102-
it "raises NoMethodError if passed something else than an Integer" do
103-
-> { Tempfile.create(mode: "wb") }.should raise_error(NoMethodError, "undefined method '|' for an instance of String")
111+
it "raises NoMethodError if passed a String mode" do
112+
-> { Tempfile.create(mode: "wb") }.should raise_error(NoMethodError, /undefined method ['`]|' for .+String/)
104113
end
105114
end
106115

0 commit comments

Comments
 (0)