Implement `has_dir' condition keyword

This commit is contained in:
Thibault Jouan
2014-01-21 15:02:07 +00:00
parent 9d7af04d28
commit 0b4df20f55
7 changed files with 69 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
Given /^a remote directory named "([^"]+)"$/ do |path|
create_dir path
end
Given /^a remote file named "([^"]+)"$/ do |file_name|
write_file file_name, ''
end

View File

@@ -0,0 +1,23 @@
@sshd
Feature: `has_dir' condition keyword
Background:
Given a recipe with:
"""
target 'some_host.test'
task :testing_directory_existence do
condition { has_dir 'some_directory' }
echo 'evaluated'
end
"""
Scenario: succeeds when directory exists
Given a remote directory named "some_directory"
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when directory does not exist
When I successfully execute the recipe
Then the output must not contain "evaluated"