Sha256: aa945e2d866396253be56307f796b39c6e5ac0f83b48f99a3cfab1a5972922e8

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Thu Nov  1 19:33:45 JST 2007
#

require 'test/unit'
require 'openwfe/expressions/flowexpression'

include OpenWFE


class FeLookupAttTest < Test::Unit::TestCase

    #def setup
    #end

    #def teardown
    #end

    def test_0

        attributes = { 
            "a" => true, 
            "b" => false,
        }
        fe = FlowExpression.new(nil, nil, nil, nil, attributes)

        assert_equal true, fe.lookup_boolean_attribute("a", nil)
        assert_equal true, fe.lookup_boolean_attribute(:a, nil)
        assert_equal true, fe.lookup_boolean_attribute("a", nil, false)
        assert_equal true, fe.lookup_boolean_attribute(:a, nil, false)
        assert_equal true, fe.lookup_boolean_attribute("a", nil, true)
        assert_equal true, fe.lookup_boolean_attribute(:a, nil, true)

        assert_equal false, fe.lookup_boolean_attribute("b", nil)
        assert_equal false, fe.lookup_boolean_attribute(:b, nil)
        assert_equal false, fe.lookup_boolean_attribute("b", nil, false)
        assert_equal false, fe.lookup_boolean_attribute(:b, nil, false)
        assert_equal false, fe.lookup_boolean_attribute("b", nil, true)
        assert_equal false, fe.lookup_boolean_attribute(:b, nil, true)

        # a fat but fast test
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.16 test/fe_lookup_att_test.rb