Sha256: 61667317d3d986a21a74665f053183a7c4e4c0ac72a5604bc6cc9c883a161a76

Contents?: true

Size: 957 Bytes

Versions: 12

Compression:

Stored size: 957 Bytes

Contents

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

class MockRobot
  attr_reader :name

  def initialize(name)
    @name = name
  end

  def devices
    ["#{name}-device1", "#{name}-device2", "#{name}-device3"]
  end

  def connections
    ["#{name}-connection1", "#{name}-connection2", "#{name}-connection3"]
  end
end

describe Artoo::Master do
  before do
    @robots = []

    @robot1 = MockRobot.new("robot1")
    @robot2 = MockRobot.new("robot2")
    @robot3 = MockRobot.new("robot3")
    
    @robots << @robot1
    @robots << @robot2
    @robots << @robot3

    @master = Artoo::Master.new(@robots)
  end

  it 'Artoo::Master#robot' do
    @master.robot("robot2").must_equal @robot2
  end

  it 'Artoo::Master#robot_devices' do
    @master.robot_devices("robot2").first.must_equal "robot2-device1"
  end

  it 'Artoo::Master#robot_connections' do
    @master.robot_connections("robot2").last.must_equal "robot2-connection3"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
artoo-1.1.0 test/master_test.rb
artoo-1.1.0.pre test/master_test.rb
artoo-1.0.0 test/master_test.rb
artoo-1.0.0.rc4 test/master_test.rb
artoo-1.0.0.rc3 test/master_test.rb
artoo-1.0.0.rc2 test/master_test.rb
artoo-1.0.0.rc1 test/master_test.rb
artoo-1.0.0.pre test/master_test.rb
artoo-0.5.0 test/master_test.rb
artoo-0.4.1 test/master_test.rb
artoo-0.4.0 test/master_test.rb
artoo-0.3.0 test/master_test.rb