Sha256: b25363a28ebcf1f9fdab7dc85981c0c02d66e944a072fc67379e96f3589e5f03

Contents?: true

Size: 624 Bytes

Versions: 4

Compression:

Stored size: 624 Bytes

Contents

#
# Testing the 'rufus-scheduler'
#
# John Mettraux at openwfe.org
#
# Sun Jul 13 19:20:27 JST 2008
#

require 'test/unit'
require 'rufus/scheduler'


#
# checking if bug #20893 got fixed
#

class Scheduler7Test < Test::Unit::TestCase

  #def setup
  #end

  #def teardown
  #end

  def test_0

    count = 0

    s = Rufus::Scheduler.start_new

    job_id = s.schedule_every('5s') do |job_id, at, params|
      count += 1
      sleep 3
    end

    sleep 6

    assert_equal 1, s.every_job_count

    s.unschedule job_id

    sleep 6

    s.stop

    assert_equal 0, s.every_job_count
    assert_equal 1, count
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rufus-scheduler-1.0.10 test/scheduler_7_test.rb
rufus-scheduler-1.0.9 test/scheduler_7_test.rb
rufus-scheduler-1.0.8 test/scheduler_7_test.rb
rufus-scheduler-1.0.11 test/scheduler_7_test.rb