Sha256: e1a507aeb5f06d69d2e2cca184f7032d789c755e5de0164629b465d764b2d718

Contents?: true

Size: 838 Bytes

Versions: 4

Compression:

Stored size: 838 Bytes

Contents

require 'spec_helper'

describe Net::NTLM::FieldSet do

  fields = []

  it_behaves_like 'a fieldset', fields

  subject(:fieldset_class) do
    Class.new(Net::NTLM::FieldSet)
  end

  context 'an instance' do
    subject(:fieldset_object) do
      fieldset_class.string(:test_string, { :value => 'Test', :active => true, :size => 4})
      fieldset_class.string(:test_string2, { :value => 'Foo', :active => true, :size => 3})
      fieldset_class.new
    end

    it 'should serialize all the fields' do
      fieldset_object.serialize.should == 'TestFoo'
    end

    it 'should parse a string across the fields' do
      fieldset_object.parse('FooBarBaz')
      fieldset_object.serialize.should == 'FooBarB'
    end

    it 'should return an aggregate size of all the fields' do
      fieldset_object.size.should == 7
    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_set_spec.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/rubyntlm-0.4.0/spec/lib/net/ntlm/field_set_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rubyntlm-0.4.0/spec/lib/net/ntlm/field_set_spec.rb
rubyntlm-0.4.0 spec/lib/net/ntlm/field_set_spec.rb