Sha256: d1e0af9e25e5f15fbc11f2f3926143ca54a3ade252baf3f5839a69bdba3487fa

Contents?: true

Size: 787 Bytes

Versions: 8

Compression:

Stored size: 787 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/test_helper")

class ConnectionTestRobot < Artoo::Robot
  connection :test_connection
end

describe Artoo::Connection do
  before do
    @robot = ConnectionTestRobot.new
    @connection = @robot.default_connection
  end

  it 'Artoo::Connection#connect' do
    @connection.connect
    @connection.adaptor.must_be_kind_of Artoo::Adaptors::Loopback
  end

  it 'Artoo::Connection#disconnect' do
    @connection.connect
    @connection.disconnect
    @connection.connected?.must_equal false
  end

  it 'Artoo::Connection#as_json' do
    MultiJson.load(@connection.as_json, :symbolize_keys => true)[:name].must_equal "test_connection"
    MultiJson.load(@connection.as_json, :symbolize_keys => true)[:connected].must_equal false
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
artoo-0.4.1 test/connection_test.rb
artoo-0.4.0 test/connection_test.rb
artoo-0.3.0 test/connection_test.rb
artoo-0.2.0 test/connection_test.rb
artoo-0.1.3 test/connection_test.rb
artoo-0.1.2 test/connection_test.rb
artoo-0.1.1 test/connection_test.rb
artoo-0.1.0 test/connection_test.rb