Sha256: c1cd80606b50718ec3ecc0ec36b6d695b959be487dbe86fdcbd900c66337b37a

Contents?: true

Size: 952 Bytes

Versions: 11

Compression:

Stored size: 952 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
      expect(field_without_size.size).to eq(0)
    end

    it 'should return 0 if active but no size specified' do
      field_without_size.active = true
      expect(field_without_size.size).to eq(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
      expect(field_with_size.size).to eq(100)
    end

    it 'should still return 0 if not active' do
      field_with_size.active = false
      expect(field_with_size.size).to eq(0)
    end
  end



end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rubyntlm-0.6.1/spec/lib/net/ntlm/field_spec.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
rubyntlm-0.6.1 spec/lib/net/ntlm/field_spec.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/spec/lib/net/ntlm/field_spec.rb
rubyntlm-0.6.0 spec/lib/net/ntlm/field_spec.rb