Sha256: 1f1b5b1f01c8762a10705756cbfd16a83d8e23a0d51fee69fb6fec54761e10c8

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

require 'pio/open_flow10/set_vlan_priority'

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

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

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

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

      describe '#action_length' do
        Then { set_vlan_priority.action_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

5 entries across 5 versions & 1 rubygems

Version Path
pio-0.30.1 spec/pio/open_flow10/set_vlan_priority_spec.rb
pio-0.30.0 spec/pio/open_flow10/set_vlan_priority_spec.rb
pio-0.29.0 spec/pio/open_flow10/set_vlan_priority_spec.rb
pio-0.28.1 spec/pio/open_flow10/set_vlan_priority_spec.rb
pio-0.28.0 spec/pio/open_flow10/set_vlan_priority_spec.rb