Sha256: 8ab4bd5073ed839a974f55a6e3d606fe748183626ea3bd905682fa46f3cf858d

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

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

require 'pp'
require 'test/unit'

require 'openwfe/util/scheduler'


#
# testing the Scheduler's CronLine system
#
class CronLineTest < Test::Unit::TestCase

    #def setup
    #end

    #def teardown
    #end

    def do_cltest (line, array)
        cl = OpenWFE::CronLine.new(line)

        unless cl.to_array == array
            puts
            pp cl.to_array
            puts "   should be"
            pp array
        end

        assert \
            cl.to_array == array
    end

    def test_cron_line_0
        do_cltest "* * * * *", [ nil, nil, nil, nil, nil ]
        do_cltest "10-12 * * * *", [ [10, 11, 12], nil, nil, nil, nil ]
        do_cltest "* * * * sun,mon", [ nil, nil, nil, nil, [7, 1] ]
        do_cltest "* * * * mon-wed", [ nil, nil, nil, nil, [1, 2, 3] ]

        #do_cltest "* * * * sun,mon-tue", [ nil, nil, nil, nil, [7, 1, 2] ]
        #do_cltest "* * * * 7-1", [ nil, nil, nil, nil, [7, 1, 2] ]
    end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
openwferu-0.9.10 test/cronline_test.rb
openwferu-0.9.10.653 test/cronline_test.rb
openwferu-0.9.11 test/cronline_test.rb
openwferu-0.9.12 test/cronline_test.rb
openwferu-0.9.12.863 test/cronline_test.rb
openwferu-0.9.13 test/cronline_test.rb
openwferu-0.9.14 test/cronline_test.rb
openwferu-0.9.15 test/cronline_test.rb
openwferu-0.9.3 test/cronline_test.rb
openwferu-0.9.4 test/cronline_test.rb
openwferu-0.9.5 test/cronline_test.rb
openwferu-0.9.6 test/cronline_test.rb
openwferu-0.9.7 test/cronline_test.rb
openwferu-0.9.8 test/cronline_test.rb
openwferu-0.9.9 test/cronline_test.rb