Class: ServerErrorTest
Instance Method Summary
collapse
#assert_array_equal, expect, #run
Instance Method Details
#test_create_with_empty_error ⇒ Object
13
14
15
16
17
|
# File 'lib/gems/xmpp4r-0.4/test/tc_errors.rb', line 13
def test_create_with_empty_error
e = ErrorResponse.new()
ee = ServerError.new(e)
assert_equal(nil, e.error)
end
|
#test_create_with_error_code ⇒ Object
19
20
21
22
23
|
# File 'lib/gems/xmpp4r-0.4/test/tc_errors.rb', line 19
def test_create_with_error_code
e = ErrorResponse.new('payment-required')
ee = ServerError.new(e)
assert_equal("payment-required: ", ee.to_s)
end
|
#test_to_s_with_error_code_and_text ⇒ Object
42
43
44
45
46
47
48
49
50
|
# File 'lib/gems/xmpp4r-0.4/test/tc_errors.rb', line 42
def test_to_s_with_error_code_and_text
e = ErrorResponse.new('payment-required', 'cuz you are a deadbeat.')
ee = ServerError.new(e)
assert_equal("payment-required: cuz you are a deadbeat.", ee.to_s)
assert_equal('payment-required', e.error)
assert_equal(402, ee.error.code)
assert_equal(:auth, ee.error.type)
assert_equal("cuz you are a deadbeat.", ee.error.text)
end
|
#test_to_s_with_error_code_but_no_text ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'lib/gems/xmpp4r-0.4/test/tc_errors.rb', line 32
def test_to_s_with_error_code_but_no_text
e = ErrorResponse.new('payment-required')
ee = ServerError.new(e)
assert_equal("payment-required: ", ee.to_s)
assert_equal('payment-required', e.error)
assert_equal(402, ee.error.code)
assert_equal(:auth, ee.error.type)
assert_equal(nil, ee.error.text)
end
|