File: message_shared.rb

package info (click to toggle)
ruby-ntlm 0.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 408 kB
  • sloc: ruby: 2,663; makefile: 6
file content (35 lines) | stat: -rw-r--r-- 981 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
shared_examples_for 'a message' do |flags|

  subject(:test_message) do
    unless described_class.names.include?(:flag)
      described_class.int32LE(:flag, {:value => Net::NTLM::DEFAULT_FLAGS[:TYPE1] })
    end
    described_class.new
  end

  it { should respond_to :has_flag? }
  it { should respond_to :set_flag }
  it { should respond_to :dump_flags }
  it { should respond_to :encode64 }
  it { should respond_to :decode64 }
  it { should respond_to :head_size }
  it { should respond_to :data_size }
  it { should respond_to :size }
  it { should respond_to :security_buffers }
  it { should respond_to :deflag }
  it { should respond_to :data_edge }

  flags.each do |flag|
    it "should be able to check if the #{flag} flag is set" do
      expect(test_message.has_flag?(flag)).to be(true)
    end
  end


  it 'should be able to set a new flag' do
    test_message.set_flag(:DOMAIN_SUPPLIED)
    expect(test_message.has_flag?(:DOMAIN_SUPPLIED)).to be(true)
  end


end