Sha256: 2ef96b58a5dba3e8c061de319360f5aa68282ff28e2c8b443f379071d6450a7b

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 Bytes

Contents

require 'spec_helper'

DISPLAY_SPEEDS = {
  :fastest => '1',
  :faster => '2',
  :normal => '3',
  :slow => '4',
  :slower => '5',
}

describe MovingsignApi::DisplaySpeed do
  describe '::parse' do
    it "Symbol" do
      DISPLAY_SPEEDS.keys.each do |key|
        expect(described_class.parse(key).key).to eq key
      end

      # invalid keys
      expect {described_class.parse(:invalid).key}.to raise_error(MovingsignApi::InvalidInputError)
      expect {described_class.parse(nil).key}.to raise_error(MovingsignApi::InvalidInputError)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
movingsign_api-0.0.2 spec/display_speed_spec.rb
movingsign_api-0.0.1 spec/display_speed_spec.rb