# 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 end