Sha256: ca4469cb55312fbd23b2f29ed8be659764b867f00e9db15bccfee75b849b2f51

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

require "spec_helpers"

describe Wayfarer::Task do
  subject(:task) { build(:task) }

  describe "#metadata" do
    it "returns an OpenStruct" do
      expect(task.metadata).to be_an(OpenStruct)
    end
  end

  describe "#barrier" do
    it "returns its batch barrier" do
      expect(task.barrier).to be_a(Wayfarer::Redis::Barrier)
      expect(task.barrier.batch).to eq(task.batch)
    end
  end

  describe "#counter" do
    it "returns its batch counter" do
      expect(task.counter).to be_a(Wayfarer::Redis::Counter)
      expect(task.counter.batch).to eq(task.batch)
    end
  end

  describe "#gc" do
    it "returns a garbage collector" do
      expect(task.gc).to be_a(Wayfarer::GC)
      expect(task.gc.task).to be(task)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wayfarer-0.4.6 spec/task_spec.rb
wayfarer-0.4.5 spec/task_spec.rb
wayfarer-0.4.4 spec/task_spec.rb