Permalink
Browse files

Merge pull request #1647 from neerajdotname/make_tests_stronger

Make tests stronger, cleaner and slimmer
  • Loading branch information...
josevalim committed Jun 11, 2011
2 parents 94df84a + f3c9f32 commit 1829dd91757c5ac337b5e11323c693e75bf2f771
@@ -612,7 +612,6 @@ def test_should_detect_if_cookie_is_deleted
send(method, :test_remote_addr)
assert false, "expected RuntimeError, got nothing"
rescue RuntimeError => error
- assert true
assert_match(%r{@#{variable} is nil}, error.message)
rescue => error
assert false, "expected RuntimeError, got #{error.class}"
@@ -293,8 +293,8 @@ def test_multiple_includes_maintain_distinct_options
first_class.default_url_options[:host] = first_host
second_class.default_url_options[:host] = second_host
- assert_equal first_class.default_url_options[:host], first_host
- assert_equal second_class.default_url_options[:host], second_host
+ assert_equal first_host, first_class.default_url_options[:host]
+ assert_equal second_host, second_class.default_url_options[:host]
end
def test_with_stringified_keys
@@ -30,7 +30,7 @@ def setup
def test_check_parameters
with_test_route_set do
get "/"
- assert_blank @controller.response.body
+ assert_equal '', @controller.response.body
end
end
@@ -162,7 +162,7 @@ def test_register_and_use_xml_simple
def test_use_xml_ximple_with_empty_request
with_test_route_set do
assert_nothing_raised { post "/", "", {'CONTENT_TYPE' => 'application/xml'} }
- assert_blank @controller.response.body
+ assert_equal '', @controller.response.body
end
end

0 comments on commit 1829dd9

Please sign in to comment.