File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 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.
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
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
You can’t perform that action at this time.
0 commit comments