Sha256: 8856e674d406fdd4a6c981c4570bef7cbb0dd6c423769171310fc96ca6f12d62

Contents?: true

Size: 999 Bytes

Versions: 20

Compression:

Stored size: 999 Bytes

Contents

require 'pio/set_vlan_priority'

describe Pio::SetVlanPriority do
  describe '.new' do
    When(:set_vlan_priority) { Pio::SetVlanPriority.new(priority) }

    context 'with 3' do
      When(:priority) { 3 }

      describe '#vlan_priority' do
        Then { set_vlan_priority.vlan_priority == 3 }
      end

      describe '#type' do
        Then { set_vlan_priority.type == 2 }
      end

      describe '#message_length' do
        Then { set_vlan_priority.message_length == 8 }
      end

      describe '#to_binary' do
        Then { set_vlan_priority.to_binary.length == 8 }
      end
    end

    context 'with -1' do
      When(:priority) { -1 }
      Then { set_vlan_priority == Failure(ArgumentError) }
    end

    context 'with 8' do
      When(:priority) { 8 }
      Then { set_vlan_priority == Failure(ArgumentError) }
    end

    context 'with :INVALID_PRIORITY' do
      When(:priority) { :INVALID_PRIORITY }
      Then { set_vlan_priority == Failure(TypeError) }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pio-0.21.0 spec/pio/set_vlan_priority_spec.rb
pio-0.20.1 spec/pio/set_vlan_priority_spec.rb
pio-0.20.0 spec/pio/set_vlan_priority_spec.rb
pio-0.19.0 spec/pio/set_vlan_priority_spec.rb
pio-0.18.2 spec/pio/set_vlan_priority_spec.rb
pio-0.18.1 spec/pio/set_vlan_priority_spec.rb
pio-0.18.0 spec/pio/set_vlan_priority_spec.rb
pio-0.17.0 spec/pio/set_vlan_priority_spec.rb
pio-0.16.0 spec/pio/set_vlan_priority_spec.rb
pio-0.15.2 spec/pio/set_vlan_priority_spec.rb
pio-0.15.1 spec/pio/set_vlan_priority_spec.rb
pio-0.15.0 spec/pio/set_vlan_priority_spec.rb
pio-0.14.0 spec/pio/set_vlan_priority_spec.rb
pio-0.13.0 spec/pio/set_vlan_priority_spec.rb
pio-0.12.0 spec/pio/set_vlan_priority_spec.rb
pio-0.11.2 spec/pio/set_vlan_priority_spec.rb
pio-0.11.1 spec/pio/set_vlan_priority_spec.rb
pio-0.11.0 spec/pio/set_vlan_priority_spec.rb
pio-0.10.1 spec/pio/set_vlan_priority_spec.rb
pio-0.10.0 spec/pio/set_vlan_priority_spec.rb