Permalink
Browse files

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.
  • Loading branch information...
eileencodes authored and rafaelfranca committed Jan 28, 2016
1 parent c03c26c commit 881f561211add98f4737287f3df5042eac3f8768
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/test/controller/render_test.rb
@@ -311,13 +311,14 @@ def test_dynamic_render_with_file
end
def test_dynamic_render_with_absolute_path
- file = Tempfile.new
+ file = Tempfile.new('name')
file.write "secrets!"
file.flush
assert_raises ActionView::MissingTemplate do
response = get :dynamic_render, { id: file.path }
end
ensure
+ file.close
file.unlink
end

0 comments on commit 881f561

Please sign in to comment.