Sha256: b099d7127e1fe3869e2035f8704bc21a001f42776e5b5945c3de172e33c2c477

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Sun Oct 29 16:18:25 JST 2006
#

require 'test/unit'

require 'openwfe/engine/engine'
require 'openwfe/participants/participants'

#
# testing misc things
#

class ParticipantTest < Test::Unit::TestCase

    def setup
        @engine = OpenWFE::Engine.new
    end

    def teardown
        @engine.stop
    end

    def test_lookup_participant

        @engine.register_participant :toto, NullParticipant

        p = @engine.get_participant "toto"
        assert_kind_of NullParticipant, p

        p = @engine.get_participant :toto
        assert_kind_of NullParticipant, p

        assert_equal 1, @engine.get_participant_map.size
    end

    def test_unregister_participant

        assert ( ! @engine.unregister_participant(:nada))

        @engine.register_participant :toto, NullParticipant

        assert_equal 1, @engine.get_participant_map.size

        assert @engine.unregister_participant(:toto)

        assert_equal 0, @engine.get_participant_map.size

        @engine.register_participant "user_.*", NullParticipant

        assert_equal 1, @engine.get_participant_map.size

        assert @engine.unregister_participant("user_.*")

        assert_equal 0, @engine.get_participant_map.size
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.16 test/participant_test.rb