Sha256: a09622692898dc19836d84099f729ca6fcc685c15e218bb611b9b4c3750ba456

Contents?: true

Size: 1011 Bytes

Versions: 13

Compression:

Stored size: 1011 Bytes

Contents

#
# testing ruote
#
# Tue Oct 27 16:13:41 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')


class EftCronTest < Test::Unit::TestCase
  include FunctionalBase

  def test_cron

    pdef = Ruote.process_definition do
      cron '* * * * * *' do
        echo 'ok'
      end
    end

    #noisy

    t = Time.now
    wfid = @engine.launch(pdef)

    wait_for(7)

    d = Time.now - t

    @engine.cancel_process(wfid)

    wait_for(5)

    assert_match /^ok\nok/, @tracer.to_s
    assert_nil @engine.process(wfid)
    assert_equal 0, @engine.storage.get_many('schedules').size
    #assert d < 5.0, "#{d} < 5.0 :("
  end

  def test_every

    pdef = Ruote.process_definition do
      every '1s' do
        echo 'ok'
      end
    end

    #noisy

    wfid = @engine.launch(pdef)

    wait_for(7)

    @engine.cancel_process(wfid)

    wait_for(5)

    assert_match /^ok\nok/, @tracer.to_s
    assert_nil @engine.process(wfid)
    assert_equal 0, @engine.storage.get_many('schedules').size
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/functional/eft_29_cron.rb
ruote-2.2.0 test/functional/eft_29_cron.rb
ruote-2.1.11 test/functional/eft_29_cron.rb
ruote-2.1.10 test/functional/eft_29_cron.rb
ruote-2.1.9 test/functional/eft_29_cron.rb
ruote-2.1.8 test/functional/eft_29_cron.rb
ruote-2.1.7 test/functional/eft_29_cron.rb
ruote-2.1.6 test/functional/eft_29_cron.rb
ruote-2.1.5 test/functional/eft_29_cron.rb
ruote-2.1.4 test/functional/eft_29_cron.rb
ruote-2.1.3 test/functional/eft_29_cron.rb
ruote-2.1.2 test/functional/eft_29_cron.rb
ruote-2.1.1 test/functional/eft_29_cron.rb