Rename all `has_*' test keywords

This commit is contained in:
Thibault Jouan 2014-04-23 20:19:39 +00:00
parent 66e3dfd186
commit b995ef2680
7 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,5 @@
@sshd
Feature: `has_dir' condition keyword
Feature: `dir?' condition keyword
Background:
Given a recipe with:
@ -7,7 +7,7 @@ Feature: `has_dir' condition keyword
target 'some_host.test'
task :testing_directory_existence do
condition { has_dir 'some_directory' }
condition { dir? 'some_directory' }
echo 'evaluated'
end

View File

@ -1,5 +1,5 @@
@sshd
Feature: `has_env' condition keyword
Feature: `env?' condition keyword
Scenario: succeeds when remote environment variable is defined
Given a recipe with:
@ -7,7 +7,7 @@ Feature: `has_env' condition keyword
target 'some_host.test'
task :testing_env_var_definition do
condition { has_env :shell }
condition { env? :shell }
echo 'evaluated'
end
@ -21,7 +21,7 @@ Feature: `has_env' condition keyword
target 'some_host.test'
task :testing_env_var_definition do
condition { has_env :inexistent_var }
condition { env? :inexistent_var }
echo 'evaluated'
end

View File

@ -1,5 +1,5 @@
@sshd
Feature: `has_executable' condition keyword
Feature: `executable?' condition keyword
Scenario: succeeds when remote executable is available
Given a recipe with:
@ -7,7 +7,7 @@ Feature: `has_executable' condition keyword
target 'some_host.test'
task :testing_executable_availability do
condition { has_executable 'true' }
condition { executable? 'true' }
echo 'evaluated'
end
@ -21,7 +21,7 @@ Feature: `has_executable' condition keyword
target 'some_host.test'
task :testing_executable_availability do
condition { has_executable 'some_non_existent_executable' }
condition { executable? 'some_non_existent_executable' }
echo 'evaluated'
end

View File

@ -1,5 +1,5 @@
@sshd
Feature: `has_file' condition keyword
Feature: `file?' condition keyword
Background:
Given a recipe with:
@ -7,7 +7,7 @@ Feature: `has_file' condition keyword
target 'some_host.test'
task :testing_file_existence do
condition { has_file 'some_file' }
condition { file? 'some_file' }
echo 'evaluated'
end

View File

@ -7,13 +7,13 @@ Feature: negated test prefix (no_)
target 'some_host.test'
task :successful_test do
condition { has_env :shell }
condition { env? :shell }
echo 'successful_test'
end
task :negated_test do
condition { no_has_env :shell }
condition { no_env? :shell }
echo 'negated_test'
end
@ -28,13 +28,13 @@ Feature: negated test prefix (no_)
target 'some_host.test'
task :failing_test do
condition { has_env :inexistent_var }
condition { env? :inexistent_var }
echo 'failing_test'
end
task :negated_test do
condition { no_has_env :inexistent_var }
condition { no_env? :inexistent_var }
echo 'negated_test'
end

View File

@ -16,10 +16,10 @@ module Producer
define_test :`, Tests::ShellCommandStatus
define_test :sh, Tests::ShellCommandStatus
define_test :file_contains, Tests::FileContains
define_test :has_env, Tests::HasEnv
define_test :has_executable, Tests::HasExecutable
define_test :has_dir, Tests::HasDir
define_test :has_file, Tests::HasFile
define_test :env?, Tests::HasEnv
define_test :executable?, Tests::HasExecutable
define_test :dir?, Tests::HasDir
define_test :file?, Tests::HasFile
attr_reader :block, :env, :tests

View File

@ -11,10 +11,10 @@ module Producer::Core
`
sh
file_contains
has_dir
has_env
has_executable
has_file
dir?
env?
executable?
file?
].each do |test|
it "has `#{test}' test defined" do
expect(dsl).to respond_to test.to_sym