Sha256: ecdaa853620a9e4b2c5ac96d9edaa82bb12f91e16276ad56b8ba89954e895513
Contents?: true
Size: 718 Bytes
Versions: 7
Compression:
Stored size: 718 Bytes
Contents
require 'spec_helper' RSpec.describe FFI::WiringPi::SoftTone do before :each do allow(FFI::WiringPi::SoftTone).to receive(:soft_tone_create).and_return 0 end describe '::Pin' do it 'raises error when soft_tone_create returns non-zero' do allow(FFI::WiringPi::SoftTone).to receive(:soft_tone_create).and_return 1 expect { described_class::Pin.new 0 }.to raise_error('Something went wrong: Errno:0') end describe '#write' do subject do described_class::Pin.new 0 end it 'calls soft_tone_write', :aggregate_failures do expect(FFI::WiringPi::SoftTone).to receive(:soft_tone_write).with(0, 100) subject.write(100) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems