Sha256: d9be217c0e72836f20d161ef10a7b73fc0b392d80483420209113e0bbe7bce25
Contents?: true
Size: 787 Bytes
Versions: 2
Compression:
Stored size: 787 Bytes
Contents
require_relative "../spec_helper" describe Minilab::MinilabWrapper do before { @mox = create_mocks(:minilab_hardware) } subject { described_class.new(@mox) } it "forwards methods to the hardware and gives the result" do @minilab_hardware.razzle(1, 2, "three").returns({ :value => 5 }) assert_equal 5, subject.razzle(1, 2, "three") @minilab_hardware.dazzle.returns({ :value => :whatever }) assert_equal :whatever, subject.dazzle end it "raise an error when there is a hardware error" do @minilab_hardware.bang(1, 2).returns({ :error => 4 }) @minilab_hardware.get_error_string(4).returns "Righteous error" -> { subject.bang(1,2) }.should raise_error("Command [bang([1, 2])] caused a hardware error: Righteous error") end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
minilab-2.0.1-x86-mingw32 | spec/unit/minilab_wrapper_spec.rb |
minilab-2.0.0-x86-mingw32 | spec/unit/minilab_wrapper_spec.rb |