Sha256: 0a141323e0d9bb794a1aa28c067863736403d14e1a2878e8c47420e46ead35f9

Contents?: true

Size: 1010 Bytes

Versions: 9

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class ConnectionTest < Test::Unit::TestCase
    should "list connections" do
      connections = Connection.list
      assert_requested :get, "#{Telnyx.api_base}/v2/connections"
      assert_kind_of ListObject, connections
      assert connections.first.is_a?(Connection) ||
             connections.first.is_a?(IPConnection) ||
             connections.first.is_a?(FQDNConnection) ||
             connections.first.is_a?(CredentialConnection),
             "Unexpected type: #{connections.first.class}"
    end

    should "retrieve a connection" do
      connection = Connection.retrieve("id")
      assert_requested :get, "#{Telnyx.api_base}/v2/connections/id"
      assert connection.is_a?(Connection) ||
             connection.is_a?(IPConnection) ||
             connection.is_a?(FQDNConnection) ||
             connection.is_a?(CredentialConnection),
             "Unexpected type: #{connection.class}"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
telnyx-2.9.0 test/telnyx/connection_test.rb
telnyx-2.8.0 test/telnyx/connection_test.rb
telnyx-2.7.0 test/telnyx/connection_test.rb
telnyx-2.6.0 test/telnyx/connection_test.rb
telnyx-2.5.0 test/telnyx/connection_test.rb
telnyx-2.4.0 test/telnyx/connection_test.rb
telnyx-2.3.0 test/telnyx/connection_test.rb
telnyx-2.2.0 test/telnyx/connection_test.rb
telnyx-0.1.0 test/telnyx/connection_test.rb