mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/xmlrpc/parser.rb (FaultException): fix to_s and inspect
* test/xmlrpc/parser.rb: test for the above Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6e7544f132
commit
c0f09a8a35
2 changed files with 7 additions and 2 deletions
|
@ -54,11 +54,10 @@ module XMLRPC
|
|||
class FaultException < StandardError
|
||||
attr_reader :faultCode, :faultString
|
||||
|
||||
alias message faultString
|
||||
|
||||
def initialize(faultCode, faultString)
|
||||
@faultCode = faultCode
|
||||
@faultString = faultString
|
||||
super(@faultString)
|
||||
end
|
||||
|
||||
# returns a hash
|
||||
|
|
|
@ -65,6 +65,12 @@ module GenericParserTest
|
|||
assert_equal(fault.faultCode, 4)
|
||||
assert_equal(fault.faultString, "an error message")
|
||||
end
|
||||
|
||||
def test_fault_message
|
||||
fault = XMLRPC::FaultException.new(1234, 'an error message')
|
||||
assert_equal('an error message', fault.to_s)
|
||||
assert_equal('#<XMLRPC::FaultException: an error message>', fault.inspect)
|
||||
end
|
||||
end
|
||||
|
||||
# create test class for each installed parser
|
||||
|
|
Loading…
Reference in a new issue