Skip to content

Commit

Permalink
Tweaked wording used in some tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmck committed Oct 25, 2015
1 parent 6843cf6 commit a97dcde
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions actionpack/test/dispatch/show_exceptions_test.rb
Expand Up @@ -93,13 +93,13 @@ def call(env)
assert_kind_of AbstractController::ActionNotFound, env["action_dispatch.exception"]
assert_equal "/404", env["PATH_INFO"]
assert_equal "/not_found_original_exception", env["action_dispatch.original_path"]
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED BRO"]]
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED"]]
end

@app = ActionDispatch::ShowExceptions.new(Boomer.new, exceptions_app)
get "/not_found_original_exception", headers: { 'action_dispatch.show_exceptions' => true }
assert_response 404
assert_equal "YOU FAILED BRO", body
assert_equal "YOU FAILED", body
end

test "returns an empty response if custom exceptions app returns X-Cascade pass" do
Expand Down
@@ -1 +1 @@
Great story, bro!
Great story!
Expand Up @@ -83,10 +83,10 @@ def test_has_many_and_belongs_to_automatic_inverse_shares_objects_on_rating

assert_equal rating.comment, comment, "The Rating's comment should be the original Comment"

rating.comment.body = "Brogramming is the act of programming, like a bro."
rating.comment.body = "Fennec foxes are the smallest of the foxes."
assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body"

comment.body = "Broseiden is the king of the sea of bros."
comment.body = "Kittens are adorable."
assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association"
end

Expand All @@ -97,10 +97,10 @@ def test_has_many_and_belongs_to_automatic_inverse_shares_objects_on_comment

assert_equal rating.comment, comment, "The Rating's comment should be the original Comment"

rating.comment.body = "Brogramming is the act of programming, like a bro."
rating.comment.body = "Fennec foxes are the smallest of the foxes."
assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body"

comment.body = "Broseiden is the king of the sea of bros."
comment.body = "Kittens are adorable."
assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association"
end

Expand Down
12 changes: 6 additions & 6 deletions activesupport/test/tagged_logging_test.rb
Expand Up @@ -72,23 +72,23 @@ def flush(*)
test "keeps each tag in their own thread" do
@logger.tagged("BCX") do
Thread.new do
@logger.tagged("OMG") { @logger.info "Cool story bro" }
@logger.tagged("OMG") { @logger.info "Cool story" }
end.join
@logger.info "Funky time"
end
assert_equal "[OMG] Cool story bro\n[BCX] Funky time\n", @output.string
assert_equal "[OMG] Cool story\n[BCX] Funky time\n", @output.string
end

test "keeps each tag in their own instance" do
@other_output = StringIO.new
@other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@other_output))
@logger.tagged("OMG") do
@other_logger.tagged("BCX") do
@logger.info "Cool story bro"
@logger.info "Cool story"
@other_logger.info "Funky time"
end
end
assert_equal "[OMG] Cool story bro\n", @output.string
assert_equal "[OMG] Cool story\n", @output.string
assert_equal "[BCX] Funky time\n", @other_output.string
end

Expand All @@ -97,11 +97,11 @@ def flush(*)
Thread.new do
@logger.tagged("OMG") do
@logger.flush
@logger.info "Cool story bro"
@logger.info "Cool story"
end
end.join
end
assert_equal "[FLUSHED]\nCool story bro\n", @output.string
assert_equal "[FLUSHED]\nCool story\n", @output.string
end

test "mixed levels of tagging" do
Expand Down
6 changes: 3 additions & 3 deletions railties/test/application/middleware/exceptions_test.rb
Expand Up @@ -48,15 +48,15 @@ def index
test "uses custom exceptions app" do
add_to_config <<-RUBY
config.exceptions_app = lambda do |env|
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED BRO"]]
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED"]]
end
RUBY

app.config.action_dispatch.show_exceptions = true

get "/foo"
assert_equal 404, last_response.status
assert_equal "YOU FAILED BRO", last_response.body
assert_equal "YOU FAILED", last_response.body
end

test "url generation error when action_dispatch.show_exceptions is set raises an exception" do
Expand All @@ -67,7 +67,7 @@ def index
end
end
RUBY

app.config.action_dispatch.show_exceptions = true

get '/foo'
Expand Down

0 comments on commit a97dcde

Please sign in to comment.