Sha256: 99c679f546cf6d5f25d0934f41a9280f892b2682b89df311abbbe98e4f40ba43

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

#
# Specifying rufus-scheduler
#
# Sun Mar 22 16:47:28 JST 2009
#

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


describe SCHEDULER_CLASS do

  before(:each) do
    @s = start_scheduler
  end
  after(:each) do
    stop_scheduler(@s)
  end


  it 'overrides jobs with the same id' do

    hits = []

    job0 = @s.in '1s', :job_id => 'nada' do
      hits << 0
    end

    wait_next_tick

    job1 = @s.in '1s', :job_id => 'nada' do
      hits << 1
    end

    wait_next_tick
    @s.jobs.size.should == 1

    hits.should == []

    sleep 1.5

    hits.should == [ 1 ]

    @s.jobs.size.should == 0
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rufus-scheduler-2.0.11 spec/at_in_spec.rb
rufus-scheduler-2.0.10 spec/at_in_spec.rb
rufus-scheduler-2.0.9 spec/at_in_spec.rb
rufus-scheduler-2.0.8 spec/at_in_spec.rb
rufus-scheduler-2.0.7 spec/at_in_spec.rb