Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Error messages for asserts

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit a9032c885f1ff773b193be5bd902cb482ce0f626 1 parent e8ba526
@spastorino spastorino authored jeremy committed
View
10 actionpack/test/controller/assert_select_test.rb
@@ -210,13 +210,13 @@ def test_assert_select_text_match
assert_nothing_raised { assert_select "div", "foo" }
assert_nothing_raised { assert_select "div", "bar" }
assert_nothing_raised { assert_select "div", /\w*/ }
- assert_nothing_raised { assert_select "div", /\w*/, :count=>2 }
- assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 }
+ assert_nothing_raised { assert_select "div", :text => /\w*/, :count=>2 }
+ assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 }
assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" }
assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" }
assert_nothing_raised { assert_select "div", :html=>/\w*/ }
assert_nothing_raised { assert_select "div", :html=>/\w*/, :count=>2 }
- assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 }
+ assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 }
end
end
@@ -268,8 +268,8 @@ def test_elect_with_xml_namespace_attributes
def test_css_select
render_html %Q{<div id="1"></div><div id="2"></div>}
- assert 2, css_select("div").size
- assert 0, css_select("p").size
+ assert_equal 2, css_select("div").size
+ assert_equal 0, css_select("p").size
end
def test_nested_css_select
View
2  actionpack/test/controller/helper_test.rb
@@ -87,7 +87,7 @@ def test_helper_block_include
assert_nothing_raised {
@controller_class.helper { include HelperTest::TestHelper }
}
- assert [], missing_methods
+ assert_equal [], missing_methods
end
def test_helper_method
View
12 activesupport/test/buffered_logger_test.rb
@@ -66,11 +66,11 @@ def test_should_not_mutate_message
4.times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but it is #{@output.string}"
end
@logger.flush
- assert !@output.string.empty?, @logger.send(:buffer).size
+ assert !@output.string.empty?, "@logger.send(:buffer).size.to_s should not be empty but it is empty"
end
define_method "test_disabling_auto_flush_with_#{disable.inspect}_should_flush_at_max_buffer_size_as_failsafe" do
@@ -79,11 +79,11 @@ def test_should_not_mutate_message
(ActiveSupport::BufferedLogger::MAX_BUFFER_SIZE - 1).times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but is #{@output.string}"
end
@logger.info 'there it is.'
- assert !@output.string.empty?, @logger.send(:buffer).size
+ assert !@output.string.empty?, "@logger.send(:buffer).size.to_s should not be empty but it is empty"
end
end
@@ -99,11 +99,11 @@ def test_should_auto_flush_every_n_messages
4.times do
@logger.info 'wait for it..'
- assert @output.string.empty?, @output.string
+ assert @output.string.empty?, "@output.string should be empty but it is #{@output.string}"
end
@logger.info 'there it is.'
- assert !@output.string.empty?, @output.string
+ assert !@output.string.empty?, "@output.string should not be empty but it is empty"
end
def test_should_create_the_log_directory_if_it_doesnt_exist
Please sign in to comment.
Something went wrong with that request. Please try again.