Sha256: acdc77a41297b7c9e8d336d19ddd9be0a86c652992e02a1e892cd7e6d89ce804

Contents?: true

Size: 918 Bytes

Versions: 44

Compression:

Stored size: 918 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

44 entries across 36 versions & 3 rubygems

Version Path
rubyntlm-0.6.5 spec/lib/net/ntlm/field_spec.rb
rubyntlm-0.6.4 spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/rubyntlm-0.6.3/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/rubyntlm-0.6.3/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/rubyntlm-0.6.3/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
rubyntlm-0.6.3 spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/rubyntlm-0.6.2/spec/lib/net/ntlm/field_spec.rb