diff --git a/spec/producer/core/actions/echo_spec.rb b/spec/producer/core/actions/echo_spec.rb index 4d3d90c..43ceb50 100644 --- a/spec/producer/core/actions/echo_spec.rb +++ b/spec/producer/core/actions/echo_spec.rb @@ -4,7 +4,8 @@ module Producer::Core module Actions describe Echo, :env do let(:text) { 'hello' } - subject(:echo) { described_class.new(env, text) } + let(:arguments) { [text] } + subject(:echo) { described_class.new(env, *arguments) } it_behaves_like 'action' diff --git a/spec/producer/core/actions/file_append_spec.rb b/spec/producer/core/actions/file_append_spec.rb index 15ce0d3..9683987 100644 --- a/spec/producer/core/actions/file_append_spec.rb +++ b/spec/producer/core/actions/file_append_spec.rb @@ -6,7 +6,8 @@ module Producer::Core let(:path) { 'some_path' } let(:content) { 'some content' } 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' diff --git a/spec/producer/core/actions/file_replace_content_spec.rb b/spec/producer/core/actions/file_replace_content_spec.rb index d5528e4..74f483f 100644 --- a/spec/producer/core/actions/file_replace_content_spec.rb +++ b/spec/producer/core/actions/file_replace_content_spec.rb @@ -7,7 +7,8 @@ module Producer::Core let(:pattern) { 'content' } let(:replacement) { 'other 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' diff --git a/spec/producer/core/actions/file_writer_spec.rb b/spec/producer/core/actions/file_writer_spec.rb index 3b2ed0a..8f9cdf2 100644 --- a/spec/producer/core/actions/file_writer_spec.rb +++ b/spec/producer/core/actions/file_writer_spec.rb @@ -5,8 +5,9 @@ module Producer::Core describe FileWriter, :env do let(:path) { 'some_path' } let(:content) { 'some_content' } + let(:arguments) { [path, content] } let(:options) { { } } - subject(:writer) { described_class.new(env, path, content, options) } + subject(:writer) { described_class.new(env, *arguments, options) } it_behaves_like 'action' diff --git a/spec/producer/core/actions/mkdir_spec.rb b/spec/producer/core/actions/mkdir_spec.rb index a310f3e..059ed9f 100644 --- a/spec/producer/core/actions/mkdir_spec.rb +++ b/spec/producer/core/actions/mkdir_spec.rb @@ -5,7 +5,8 @@ module Producer::Core describe Mkdir, :env do let(:path) { 'some_path' } 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' diff --git a/spec/producer/core/actions/shell_command_spec.rb b/spec/producer/core/actions/shell_command_spec.rb index fa7d6c4..9ec9c6d 100644 --- a/spec/producer/core/actions/shell_command_spec.rb +++ b/spec/producer/core/actions/shell_command_spec.rb @@ -5,7 +5,8 @@ module Producer::Core describe ShellCommand, :env do let(:command_args) { 'hello from remote host' } 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' diff --git a/spec/support/shared_action.rb b/spec/support/shared_action.rb index 80ae13a..b86b525 100644 --- a/spec/support/shared_action.rb +++ b/spec/support/shared_action.rb @@ -2,7 +2,6 @@ module Producer::Core shared_examples 'action' do include TestEnvHelpers - let(:arguments) { [:some, :arguments] } let(:options) { { foo: :bar } } subject(:action) { described_class.new(env, *arguments, options) }