This repository has been archived by the owner on Jan 29, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from dhollinger/tests
Added some more tests for the workers
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'spec_helper' | ||
|
||
describe Deploy::EnvironmentWorker do | ||
let(:environment) { 'test' } | ||
let(:config) do | ||
{ | ||
sources: { | ||
main: { | ||
remote: 'https://example.com/foo/bar', | ||
basedir: '/etc/foo/bar' | ||
} | ||
} | ||
} | ||
end | ||
|
||
let(:deploy) { double('R10K::Action::Deploy::Environment') } | ||
|
||
before do | ||
allow(R10K::Action::Deploy::Environment).to receive(:new) { deploy } | ||
end | ||
|
||
it 'successfully deploys environment' do | ||
job = Deploy::EnvironmentWorker.new | ||
expect(deploy).to receive(:call) { true } | ||
job.perform(environment, config) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'spec_helper' | ||
|
||
describe Deploy::ModuleWorker do | ||
let(:ppt_module) { 'foobar' } | ||
let(:config) do | ||
{ | ||
sources: { | ||
main: { | ||
remote: 'https://example.com/foo/bar', | ||
basedir: '/etc/foo/bar' | ||
} | ||
} | ||
} | ||
end | ||
|
||
let(:deploy) { double('R10K::Action::Deploy::Module') } | ||
|
||
before do | ||
allow(R10K::Action::Deploy::Module).to receive(:new) { deploy } | ||
end | ||
|
||
it 'successfully deploys a module' do | ||
job = Deploy::ModuleWorker.new | ||
expect(deploy).to receive(:call) { true } | ||
job.perform(ppt_module, config) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters