Sha256: 18182fee7bdaef9ee4b8b26af12f465871169430eb5cd8293b8d2940e574674f

Contents?: true

Size: 623 Bytes

Versions: 12

Compression:

Stored size: 623 Bytes

Contents

#
# Specifying rufus-scheduler
#
# Wed Apr 17 06:00:59 JST 2013
#

require 'spec_helper'


describe Rufus::Scheduler::JobArray do

  class DummyJob < Struct.new(:id, :next_time); end

  before(:each) do
    @array = Rufus::Scheduler::JobArray.new
  end

  describe '#push' do

    it 'pushes jobs' do

      @array.push(DummyJob.new('a', Time.local(0)))

      expect(@array.to_a.collect(&:id)).to eq(%w[ a ])
    end

    it 'pushes and remove duplicates' do

      j = DummyJob.new('a', Time.local(0))

      @array.push(j)
      @array.push(j)

      expect(@array.to_a.collect(&:id)).to eq(%w[ a ])
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rufus-scheduler-3.1.9 spec/job_array_spec.rb
rufus-scheduler-3.1.8 spec/job_array_spec.rb
rufus-scheduler-3.1.7 spec/job_array_spec.rb
rufus-scheduler-3.1.6 spec/job_array_spec.rb
rufus-scheduler-3.1.5 spec/job_array_spec.rb
rufus-scheduler-3.1.4 spec/job_array_spec.rb
rufus-scheduler-3.1.3 spec/job_array_spec.rb
rufus-scheduler-3.1.2 spec/job_array_spec.rb
rufus-scheduler-3.1.1 spec/job_array_spec.rb
rufus-scheduler-3.1.0 spec/job_array_spec.rb
rufus-scheduler-3.0.9 spec/job_array_spec.rb
rufus-scheduler-3.0.8 spec/job_array_spec.rb