Sha256: f07aea1b61ffee9a9f0b79fc485067cbeeba492d884a36825e702d3204851477

Contents?: true

Size: 983 Bytes

Versions: 20

Compression:

Stored size: 983 Bytes

Contents

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

class ConnectionTestRobot < Artoo::Robot
  connection :my_test_connection, :awesomeness => :high, :super_powers => :active
end

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

  it 'Artoo::Connection#connect' do
    @connection.connect
    @connection.adaptor.class.must_equal 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 "my_test_connection"
    MultiJson.load(@connection.as_json, :symbolize_keys => true)[:connected].must_equal false
  end

  it 'Artoo::Connection#additional_params' do
    @robot.default_connection.adaptor.additional_params[:awesomeness].must_equal :high
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
artoo-1.6.7 test/connection_test.rb
artoo-1.6.6 test/connection_test.rb
artoo-1.6.5 test/connection_test.rb
artoo-1.6.4 test/connection_test.rb
artoo-1.6.3 test/connection_test.rb
artoo-1.6.2 test/connection_test.rb
artoo-1.6.1 test/connection_test.rb
artoo-1.6.0 test/connection_test.rb
artoo-1.5.0 test/connection_test.rb
artoo-1.4.1 test/connection_test.rb
artoo-1.4.0 test/connection_test.rb
artoo-1.3.0 test/connection_test.rb
artoo-1.2.2 test/connection_test.rb
artoo-1.2.1 test/connection_test.rb
artoo-1.2.0 test/connection_test.rb
artoo-1.1.1 test/connection_test.rb
artoo-1.1.0 test/connection_test.rb
artoo-1.1.0.pre test/connection_test.rb
artoo-1.0.0 test/connection_test.rb
artoo-1.0.0.rc4 test/connection_test.rb