Declare arguments explicitly in actions specs
This commit is contained in:
parent
7bdb778159
commit
58f3a7223e
@ -4,7 +4,8 @@ module Producer::Core
|
|||||||
module Actions
|
module Actions
|
||||||
describe Echo, :env do
|
describe Echo, :env do
|
||||||
let(:text) { 'hello' }
|
let(:text) { 'hello' }
|
||||||
subject(:echo) { described_class.new(env, text) }
|
let(:arguments) { [text] }
|
||||||
|
subject(:echo) { described_class.new(env, *arguments) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@ module Producer::Core
|
|||||||
let(:path) { 'some_path' }
|
let(:path) { 'some_path' }
|
||||||
let(:content) { 'some content' }
|
let(:content) { 'some content' }
|
||||||
let(:added_content) { ' added' }
|
let(:added_content) { ' added' }
|
||||||
subject(:action) { described_class.new(env, path, added_content) }
|
let(:arguments) { [path, added_content] }
|
||||||
|
subject(:action) { described_class.new(env, *arguments) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@ module Producer::Core
|
|||||||
let(:pattern) { 'content' }
|
let(:pattern) { 'content' }
|
||||||
let(:replacement) { 'other content' }
|
let(:replacement) { 'other content' }
|
||||||
let(:content) { 'some content' }
|
let(:content) { 'some content' }
|
||||||
subject(:action) { described_class.new(env, path, pattern, replacement) }
|
let(:arguments) { [path, pattern, replacement] }
|
||||||
|
subject(:action) { described_class.new(env, *arguments) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@ module Producer::Core
|
|||||||
describe FileWriter, :env do
|
describe FileWriter, :env do
|
||||||
let(:path) { 'some_path' }
|
let(:path) { 'some_path' }
|
||||||
let(:content) { 'some_content' }
|
let(:content) { 'some_content' }
|
||||||
|
let(:arguments) { [path, content] }
|
||||||
let(:options) { { } }
|
let(:options) { { } }
|
||||||
subject(:writer) { described_class.new(env, path, content, options) }
|
subject(:writer) { described_class.new(env, *arguments, options) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -5,7 +5,8 @@ module Producer::Core
|
|||||||
describe Mkdir, :env do
|
describe Mkdir, :env do
|
||||||
let(:path) { 'some_path' }
|
let(:path) { 'some_path' }
|
||||||
let(:options) { { } }
|
let(:options) { { } }
|
||||||
subject(:mkdir) { described_class.new(env, path, options) }
|
let(:arguments) { [path, options] }
|
||||||
|
subject(:mkdir) { described_class.new(env, *arguments) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -5,7 +5,8 @@ module Producer::Core
|
|||||||
describe ShellCommand, :env do
|
describe ShellCommand, :env do
|
||||||
let(:command_args) { 'hello from remote host' }
|
let(:command_args) { 'hello from remote host' }
|
||||||
let(:command) { "echo #{command_args}" }
|
let(:command) { "echo #{command_args}" }
|
||||||
subject(:sh) { described_class.new(env, command) }
|
let(:arguments) { [command] }
|
||||||
|
subject(:sh) { described_class.new(env, *arguments) }
|
||||||
|
|
||||||
it_behaves_like 'action'
|
it_behaves_like 'action'
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ module Producer::Core
|
|||||||
shared_examples 'action' do
|
shared_examples 'action' do
|
||||||
include TestEnvHelpers
|
include TestEnvHelpers
|
||||||
|
|
||||||
let(:arguments) { [:some, :arguments] }
|
|
||||||
let(:options) { { foo: :bar } }
|
let(:options) { { foo: :bar } }
|
||||||
subject(:action) { described_class.new(env, *arguments, options) }
|
subject(:action) { described_class.new(env, *arguments, options) }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user