Sha256: cc7bf6420151873548906105926a5eed7897d997500a4ba18a30170aaa6a256e

Contents?: true

Size: 783 Bytes

Versions: 8

Compression:

Stored size: 783 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?
  end

  def test_malformed_2_errorness
    assert malformed_response_2.error?
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gillbus-0.17.5 test/error_test.rb
gillbus-0.17.4 test/error_test.rb
gillbus-0.17.3 test/error_test.rb
gillbus-0.17.2 test/error_test.rb
gillbus-0.17.1 test/error_test.rb
gillbus-0.16.10 test/error_test.rb
gillbus-0.16.9 test/error_test.rb
gillbus-0.16.8 test/error_test.rb