Sha256: 150231f2e4ad2d1f8a35c05951758aaaafa592a9627813de41427a569da0b6d1

Contents?: true

Size: 699 Bytes

Versions: 37

Compression:

Stored size: 699 Bytes

Contents

require "spec_helper"

require "bunny/concurrent/atomic_fixnum"
require "bunny/versioned_delivery_tag"

describe Bunny::VersionedDeliveryTag, "#stale?" do
  subject { described_class.new(2, 1) }

  context "when delivery tag version < provided version" do
    it "returns true" do
      subject.stale?(2).should be_true
    end
  end

  context "when delivery tag version = provided version" do
    it "returns false" do
      subject.stale?(1).should be_false
    end
  end

  context "when delivery tag version > provided version" do
    it "returns true" do
      # this scenario is unrealistic but we still can
      # unit test it. MK.
      subject.stale?(0).should be_false
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
bunny-1.7.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.7.0 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.3 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.2 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.0 spec/unit/version_delivery_tag_spec.rb
bunny-1.5.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.0.rc2 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.0.rc1 spec/unit/version_delivery_tag_spec.rb
bunny-1.6.0.pre1 spec/unit/version_delivery_tag_spec.rb
bunny-1.5.0 spec/unit/version_delivery_tag_spec.rb
bunny-1.5.0.pre2 spec/unit/version_delivery_tag_spec.rb
bunny-1.5.0.pre1 spec/unit/version_delivery_tag_spec.rb
bunny-1.4.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.4.0 spec/unit/version_delivery_tag_spec.rb
bunny-1.3.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.3.0 spec/unit/version_delivery_tag_spec.rb
bunny-1.2.2 spec/unit/version_delivery_tag_spec.rb
bunny-1.2.1 spec/unit/version_delivery_tag_spec.rb
bunny-1.2.0 spec/unit/version_delivery_tag_spec.rb