Skip to content

Commit 722aa32

Browse files
committed
Run file.close before unlinking for travis
This works on OSX but for some reason travis is throwing a ``` 1) Error: ExpiresInRenderTest#test_dynamic_render_with_absolute_path: NoMethodError: undefined method `unlink' for nil:NilClass ``` Looking at other tests in Railties the file has a name and we close it before unlinking, so I'm going to try that.
1 parent 5f2195a commit 722aa32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

actionpack/test/controller/render_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,14 @@ def test_dynamic_render_with_file
279279
end
280280

281281
def test_dynamic_render_with_absolute_path
282-
file = Tempfile.new
282+
file = Tempfile.new('name')
283283
file.write "secrets!"
284284
file.flush
285285
assert_raises ActionView::MissingTemplate do
286286
response = get :dynamic_render, { id: file.path }
287287
end
288288
ensure
289+
file.close
289290
file.unlink
290291
end
291292

0 commit comments

Comments
 (0)