Sha256: 3c87c3f0b85499e1252c7d4864e009dbd37d8c8fc4c5d832dd126e585d7d4887

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

require 'spec_helper'
require 'sidekiq-apriori/arb'

describe Sidekiq::Apriori::Arb do

  ## See spec/support/arb.rb for Arb class definition
  require 'support/arb'

  let(:arb)             { Arb.new  }
  let(:using_method)    { PrioritizedUsingMethod.new }
  let(:using_callable)  { PrioritizedUsingCallable.new }

  it "should validate priorities" do
    arb.priority = "none"
    arb.should be_invalid

    Sidekiq::Apriori::PRIORITIES.each do |priority|
      arb.priority = priority
      arb.should be_valid
    end
  end

  it "should attempt prioritization on creation with named prioritizer" do
    using_method.should_receive(:some_method)
    using_method.save
  end

  it "should attempt prioritization on creation with using a block" do
    using_callable.should_receive(:some_other_method)
    using_callable.save
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sidekiq-apriori-0.0.3 spec/sidekiq-apriori/arb_spec.rb
sidekiq-apriori-0.0.2 spec/sidekiq-apriori/arb_spec.rb