Sha256: fb4b62d1e797ea1a329a8607d3c91050b7d2c82995cf653608d7caa42bac6ddc

Contents?: true

Size: 615 Bytes

Versions: 5

Compression:

Stored size: 615 Bytes

Contents

require_relative 'test_helper'

require_relative '../lib/wall_e/serial_snoop'

class Dummy; end

class SerialSnoopTest < MiniTest::Unit::TestCase

  def test_no_port_available
    Dir.stub :[], [] do
      assert_nil WallE::SerialSnoop.locate_ports
    end
  end

  def test_cannot_connect_to_found_port
    Dir.stub :[], ['tty.usbmodemfd13131'] do
      assert_nil WallE::SerialSnoop.locate_ports
    end
  end

  def test_connect_to_found_port
    Dir.stub :[], ['tty.usbmodemfd13131'] do
      Firmata::Board.stub :new, Dummy.new do
        refute_nil WallE::SerialSnoop.locate_ports
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wall_e-0.1.0 test/serial_snoop_test.rb
wall_e-0.0.4 test/serial_snoop_test.rb
wall_e-0.0.3 test/serial_snoop_test.rb
wall_e-0.0.2 test/serial_snoop_test.rb
wall_e-0.0.1 test/serial_snoop_test.rb