Sha256: c39d5e1e782f1967f3c1a5a02c760aa2f5f2c9b697ffa641673559e1161d7db3

Contents?: true

Size: 785 Bytes

Versions: 17

Compression:

Stored size: 785 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

17 entries across 17 versions & 1 rubygems

Version Path
gillbus-0.16.7 test/error_test.rb
gillbus-0.16.6 test/error_test.rb
gillbus-0.16.5 test/error_test.rb
gillbus-0.16.4 test/error_test.rb
gillbus-0.16.3 test/error_test.rb
gillbus-0.16.2 test/error_test.rb
gillbus-0.16.1 test/error_test.rb
gillbus-0.15.7 test/error_test.rb
gillbus-0.15.6 test/error_test.rb
gillbus-0.15.5 test/error_test.rb
gillbus-0.15.4 test/error_test.rb
gillbus-0.15.3 test/error_test.rb
gillbus-0.15.2 test/error_test.rb
gillbus-0.15.1 test/error_test.rb
gillbus-0.15.0 test/error_test.rb
gillbus-0.14.12 test/error_test.rb
gillbus-0.14.11 test/error_test.rb