diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-10-08 15:05:18 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-10-08 15:05:18 -0300 |
commit | 0cf4662ec589813c4fdc22de3398730cab05c5ed (patch) | |
tree | d422b8d8e4ccccf9bd89443b82398e1d7313269f /activeresource | |
parent | c3f9d51a00b9e7e5f5d14e7464fae04c48198756 (diff) | |
parent | 665c7ad29d5614b8f5535d317f1dd2803ddcaa7d (diff) | |
download | rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.gz rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.bz2 rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/lib/active_resource/exceptions.rb | 5 | ||||
-rw-r--r-- | activeresource/test/cases/observing_test.rb | 2 | ||||
-rw-r--r-- | activeresource/test/connection_test.rb | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/activeresource/lib/active_resource/exceptions.rb b/activeresource/lib/active_resource/exceptions.rb index 0631cdcf9f..0f4549fd73 100644 --- a/activeresource/lib/active_resource/exceptions.rb +++ b/activeresource/lib/active_resource/exceptions.rb @@ -8,7 +8,10 @@ module ActiveResource end def to_s - "Failed with #{response.code} #{response.message if response.respond_to?(:message)}" + message = "Failed." + message << " Response code = #{response.code}." if response.respond_to?(:code) + message << " Response message = #{response.message}." if response.respond_to?(:message) + message end end diff --git a/activeresource/test/cases/observing_test.rb b/activeresource/test/cases/observing_test.rb index 9599ff7b0f..925ec7a84a 100644 --- a/activeresource/test/cases/observing_test.rb +++ b/activeresource/test/cases/observing_test.rb @@ -10,7 +10,7 @@ class ObservingTest < Test::Unit::TestCase %w( after_create after_destroy after_save after_update before_create before_destroy before_save before_update).each do |method| - define_method(method) { log method } + define_method(method) { |*| log method } end private diff --git a/activeresource/test/connection_test.rb b/activeresource/test/connection_test.rb index d7466c65b4..2a3e04272a 100644 --- a/activeresource/test/connection_test.rb +++ b/activeresource/test/connection_test.rb @@ -83,7 +83,7 @@ class ConnectionTest < Test::Unit::TestCase begin handle_response ResponseHeaderStub.new(405, "HTTP Failed...", "GET, POST") rescue ActiveResource::MethodNotAllowed => e - assert_equal "Failed with 405 HTTP Failed...", e.message + assert_equal "Failed. Response code = 405. Response message = HTTP Failed....", e.message assert_equal [:get, :post], e.allowed_methods end end |