File: anonymous_spec.rb

package info (click to toggle)
ruby-sasl 0.0.3.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 128 kB
  • sloc: ruby: 451; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'sasl'
require 'spec'

describe SASL::Anonymous do
  class MyAnonymousPreferences < SASL::Preferences
    def username
      'bob'
    end
  end
  preferences = MyAnonymousPreferences.new

  it 'should authenticate anonymously' do
    sasl = SASL::Anonymous.new('ANONYMOUS', preferences)
    sasl.start.should == ['auth', 'bob']
    sasl.success?.should == false
    sasl.receive('success', nil).should == nil
    sasl.success?.should == true
  end
end