Permalink
Browse files

ignore other warnings in test assertion. Ruby 2.0

Using Ruby 2.0 we get a failing test in actionpack:

      1) Failure:
    test_locals_option_to_assert_template_is_not_supported(RenderTest) [/Users/senny/Projects/rails/actionpack/test/controller/render_test.rb:1441]:
    --- expected
    +++ actual
    @@ -1,2 +1,3 @@
    -"the :locals option to #assert_template is only supported in a ActionView::TestCase
    +"/Users/senny/Projects/rails/actionpack/test/fixtures/test/_customer_greeting.erb:1: warning: assigned but unused variable - customer_greeting_counter
    +the :locals option to #assert_template is only supported in a ActionView::TestCase
     "

This is because there are tons of warnings emitted and the test makes
a hard match against the warning buffer.
  • Loading branch information...
1 parent ac65949 commit d0499044aa1d675ac3033917d6629fee4abe0d99 @senny committed Dec 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/test/controller/render_test.rb
@@ -1438,7 +1438,7 @@ def test_locals_option_to_assert_template_is_not_supported
get :partial_collection_with_locals
assert_template partial: 'customer_greeting', locals: { greeting: 'Bonjour' }
- assert_equal "the :locals option to #assert_template is only supported in a ActionView::TestCase\n", warning_buffer.string
+ assert_match /the :locals option to #assert_template is only supported in a ActionView::TestCase/, warning_buffer.string
ensure
$stderr = STDERR
end

0 comments on commit d049904

Please sign in to comment.