Sha256: 28d5f0e415e86ba2c5bbf2ce457eef79b4deddb752755377875fd4c3aede6b79

Contents?: true

Size: 897 Bytes

Versions: 4

Compression:

Stored size: 897 Bytes

Contents

require 'spec_helper'

describe Net::NTLM::Field do

  it_behaves_like 'a field', 'Foo', false

  context 'with no size specified' do
    let (:field_without_size) { Net::NTLM::Field.new({ :value => 'Foo', :active => true }) }
    it 'should set size to 0 if not active' do
      field_without_size.size.should == 0
    end

    it 'should return 0 if active but no size specified' do
      field_without_size.active = true
      field_without_size.size.should == 0
    end
  end

  context 'with a size specified' do
    let (:field_with_size) { Net::NTLM::Field.new({ :value => 'Foo', :active => true, :size => 100 }) }

    it 'should return the size provided in the initialize options if active' do
      field_with_size.size.should == 100
    end

    it 'should still return 0 if not active' do
      field_with_size.active = false
      field_with_size.size.should == 0
    end
  end



end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.4.0/spec/lib/net/ntlm/field_spec.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/rubyntlm-0.4.0/spec/lib/net/ntlm/field_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rubyntlm-0.4.0/spec/lib/net/ntlm/field_spec.rb
rubyntlm-0.4.0 spec/lib/net/ntlm/field_spec.rb