Skip to content

Commit

Permalink
Run file.close before unlinking for travis
Browse files Browse the repository at this point in the history
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 committed Jan 28, 2016
1 parent c1ee779 commit eae9eb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actionpack/test/controller/render_test.rb
Expand Up @@ -301,13 +301,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

Expand Down

0 comments on commit eae9eb4

Please sign in to comment.