Skip to content

Commit

Permalink
Suppress Rails 6.0's warning
Browse files Browse the repository at this point in the history
Follow up of rails/rails#35093.

This PR suppresses the following warning when using Rails 6.0.

```console
% path/to/buoys
% bundle exec rake

(snip)

DEPRECATION WARNING: ActionView::Base instances should be constructed
with a lookup context, assignments, and a controller. (called from new
at /Users/koic/src/github.com/muryoimpl/buoys/test/buoys_buoy_test.rb:7)
```
  • Loading branch information
koic committed Sep 7, 2019
1 parent 39e7fa0 commit d700f22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/buoys_buoy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

class BuoysBuoyTest < ActiveSupport::TestCase
setup do
@view_context = ActionView::Base.new
if ActionView::Base.respond_to?(:empty)
@view_context = ActionView::Base.empty
else
@view_context = ActionView::Base.new # Rails 5.2 or lower
end
Buoys::Loader.load_buoys_files
end

Expand Down

0 comments on commit d700f22

Please sign in to comment.