require 'spec_helper' describe Evrone::CI::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(Evrone::CI::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(Evrone::CI::Worker::Local).new(job, '/tmp') { local } mock(local).perform { true } end it { should be } end end end