Implement `yaml_write' action
This commit is contained in:
14
features/action_yaml_write.feature
Normal file
14
features/action_yaml_write.feature
Normal file
@@ -0,0 +1,14 @@
|
||||
@sshd
|
||||
Feature: `yaml_write' task action
|
||||
|
||||
Background:
|
||||
Given a recipe with:
|
||||
"""
|
||||
task :yaml_write_action do
|
||||
yaml_write 'some_file', data: { foo: 'bar' }
|
||||
end
|
||||
"""
|
||||
|
||||
Scenario: writes given data as YAML
|
||||
When I successfully execute the recipe on remote target
|
||||
Then the remote file "some_file" must match /^:foo: bar$/
|
@@ -22,6 +22,10 @@ Then /^the remote file "([^"]+)" must contain exactly "([^"]+)"$/ do |path, cont
|
||||
check_exact_file_content path, content
|
||||
end
|
||||
|
||||
Then /^the remote file "([^"]+)" must match \/([^\/]+)\/$/ do |path, pattern|
|
||||
check_file_content path, /#{pattern}/, true
|
||||
end
|
||||
|
||||
def stat_mode(path)
|
||||
in_current_dir do
|
||||
('%o' % [File::Stat.new(path).mode])[-4, 4]
|
||||
|
Reference in New Issue
Block a user