Sha256: 54a479bc7104f24f8271e14e8e0110acec672daabdf72f8f6258e44d001d5d28

Contents?: true

Size: 1020 Bytes

Versions: 2

Compression:

Stored size: 1020 Bytes

Contents

require_relative "../spec_helper"

# Not many tests for this class, since there isn't much behavior outside of
# calling into the minilab library. I could probably figure out another way
# to unit test those calls, but I don't believe there would be much value
# in brittle tests for code that is already covered by system tests.
describe Minilab::MinilabHardware do
  it "raise an error if auxport configuration isn't given the correct hash parameters" do
    -> { subject.configure_auxport(:pin => 3) }.should raise_error(":direction is a required parameter")
    -> { subject.configure_auxport(:direction => DIGITALIN) }.should raise_error(":pin is a required parameter")
  end

  it "raise an error if port configuration isn't given the correct hash parameters" do
    -> { subject.configure_port(:port => FIRSTPORTA) }.should raise_error(":direction is a required parameter")
    -> { subject.configure_port(:direction => DIGITALOUT) }.should raise_error(":port is a required parameter")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minilab-2.0.1-x86-mingw32 spec/unit/minilab_hardware_spec.rb
minilab-2.0.0-x86-mingw32 spec/unit/minilab_hardware_spec.rb