Implement `yaml_write' action
This commit is contained in:
25
spec/producer/core/actions/yaml_writer_spec.rb
Normal file
25
spec/producer/core/actions/yaml_writer_spec.rb
Normal 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
|
Reference in New Issue
Block a user