Skip to content

Commit 3be91cf

Browse files
committed
More slight improvements after review
1 parent 105cd57 commit 3be91cf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/tempfile/create_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
end
1010
end
1111

12-
it "returns a new, open File instance placed in tmpdir" do
12+
it "returns a new, open regular File instance placed in tmpdir" do
1313
@tempfile = Tempfile.create
1414
# Unlike Tempfile.open this returns a true File,
1515
# but `.should be_an_instance_of(File)` would be true either way.
@@ -109,7 +109,6 @@
109109
-> { Tempfile.create(:create_spec) }.should raise_error(ArgumentError, "unexpected prefix: :create_spec")
110110
-> { Tempfile.create([:create_spec]) }.should raise_error(ArgumentError, "unexpected prefix: :create_spec")
111111
-> { Tempfile.create(["create_spec", :temp]) }.should raise_error(ArgumentError, "unexpected suffix: :temp")
112-
113112
end
114113
end
115114

@@ -125,9 +124,11 @@
125124
end
126125

127126
context "when called with a mode option" do
128-
it "ORs it with the default mode, forcing it to be writable" do
127+
it "ORs it with the default mode, forcing it to be readable and writable" do
129128
@tempfile = Tempfile.create(mode: File::RDONLY)
130-
File.writable?(@tempfile.path).should be_true
129+
@tempfile.puts "test"
130+
@tempfile.rewind
131+
@tempfile.read.should == "test\n"
131132
end
132133

133134
it "raises NoMethodError if passed a String mode" do

0 commit comments

Comments
 (0)