Sha256: 46d19b921b4de0637c7b66036090b9a7347e7d3eae0197ce32f6b62f30c0941d

Contents?: true

Size: 919 Bytes

Versions: 12

Compression:

Stored size: 919 Bytes

Contents

require 'test_helper'

class ErrorTest < Minitest::Test
  def error_response
    Gillbus::SessionLogin::Response.parse_string(File.read('test/responses/error.xml'))
  end

  def malformed_response
    Gillbus::SessionLogin::Response.parse_string('not an xml')
  end

  def malformed_response_2
    Gillbus::SessionLogin::Response.parse_string('<NOTDATA></NOTDATA>')
  end

  def test_errorness
    assert error_response.error?
    assert_equal 4, error_response.error_code
    assert_equal 'Session not created error!', error_response.error_message
    assert_equal "We'r fucked", error_response.external_error_message
  end

  def test_malformed_errorness
    assert malformed_response.error?
    assert_equal "Malformed response: invalid format, expected < at line 1, column 1 [parse.c:146]\n", malformed_response.error_message
  end

  def test_malformed_2_errorness
    assert malformed_response_2.error?
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gillbus-0.18.14 test/error_test.rb
gillbus-0.18.13 test/error_test.rb
gillbus-0.18.12 test/error_test.rb
gillbus-0.18.9 test/error_test.rb
gillbus-0.18.8 test/error_test.rb
gillbus-0.18.7 test/error_test.rb
gillbus-0.18.6 test/error_test.rb
gillbus-0.18.5 test/error_test.rb
gillbus-0.18.4 test/error_test.rb
gillbus-0.18.3 test/error_test.rb
gillbus-0.18.2 test/error_test.rb
gillbus-0.18.1 test/error_test.rb