Sha256: 84511e26e1c7a765ed0916ebd9d02b1a9e79a740e31a4f8803df2c69142b2716

Contents?: true

Size: 785 Bytes

Versions: 14

Compression:

Stored size: 785 Bytes

Contents

require 'spec_helper'

describe Vx::Worker do

  context ".perform" do
    let(:job) { create :job }
    let(:run) { :docker }
    subject { described_class.perform job, '/tmp' }

    before do
      described_class.configure do |c|
        c.run = run
      end
    end

    context "when run at :docker" do
      let(:run) { :docker }
      let(:docker) { 'docker' }
      before do
        mock(Vx::Worker::Docker).new(job, '/tmp') { docker }
        mock(docker).perform { true }
      end

      it { should be }
    end

    context "when run at :local" do
      let(:run) { :local }
      let(:local) { 'local' }
      before do
        mock(Vx::Worker::Local).new(job, '/tmp') { local }
        mock(local).perform { true }
      end

      it { should be }
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vx-worker-0.3.0.pre1 spec/lib/worker_spec.rb
vx-worker-0.3.0.pre0 spec/lib/worker_spec.rb
vx-worker-0.2.1 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre38 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre37 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre36 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre35 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre34 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre33 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre32 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre31 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre30 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre29 spec/lib/worker_spec.rb
vx-worker-0.2.0.pre28 spec/lib/worker_spec.rb