Implement `yaml_write' action

This commit is contained in:
Thibault Jouan
2014-10-11 00:47:16 +00:00
parent 9780cdf220
commit 0ba12bfb90
7 changed files with 76 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
require 'spec_helper'
module Producer::Core
module Actions
describe YAMLWriter, :env do
let(:path) { 'some_path' }
let(:data) { { foo: 'bar' } }
let(:arguments) { [path] }
let(:options) { { data: data } }
subject(:writer) { described_class.new(env, *arguments, options) }
it_behaves_like 'action'
it { is_expected.to be_a FileWriter}
describe '#apply' do
it 'writes data as YAML to file on remote filesystem' do
expect(remote_fs)
.to receive(:file_write).with(path, data.to_yaml)
writer.apply
end
end
end
end
end