Skip to content

Commit

Permalink
Prefer assert_not_includes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeclaghorn committed Sep 13, 2019
1 parent ffc8475 commit d41e282
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions activesupport/test/logger_test.rb
Expand Up @@ -76,7 +76,7 @@ def test_should_log_debugging_message_when_debugging
def test_should_not_log_debug_messages_when_log_level_is_info
@logger.level = Logger::INFO
@logger.add(Logger::DEBUG, @message)
assert_not @output.string.include?(@message)
assert_not_includes @output.string, @message
end

def test_should_add_message_passed_as_block_when_using_add
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_silencing_everything_but_errors
@logger.error "THIS IS HERE"
end

assert_not @output.string.include?("NOT THERE")
assert_not_includes @output.string, "NOT THERE"
assert_includes @output.string, "THIS IS HERE"
end

Expand All @@ -153,7 +153,7 @@ def test_unsilencing
@logger.debug "THIS IS HERE"
end

assert_not @output.string.include?("NOT THERE")
assert_not_includes @output.string, "NOT THERE"
assert_includes @output.string, "THIS IS HERE"
end

Expand All @@ -172,7 +172,7 @@ def test_logger_silencing_works_for_broadcast

assert_includes @output.string, "CORRECT DEBUG"
assert_includes @output.string, "CORRECT ERROR"
assert_not @output.string.include?("FAILURE")
assert_not_includes @output.string, "FAILURE"

assert_includes another_output.string, "CORRECT DEBUG"
assert_includes another_output.string, "CORRECT ERROR"
Expand All @@ -194,7 +194,7 @@ def test_broadcast_silencing_does_not_break_plain_ruby_logger

assert_includes @output.string, "CORRECT DEBUG"
assert_includes @output.string, "CORRECT ERROR"
assert_not @output.string.include?("FAILURE")
assert_not_includes @output.string, "FAILURE"

assert_includes another_output.string, "CORRECT DEBUG"
assert_includes another_output.string, "CORRECT ERROR"
Expand Down

0 comments on commit d41e282

Please sign in to comment.