app_steps.rb 728 B

123456789101112131415161718192021222324252627
  1. Given /^a new server$/ do
  2. end
  3. Then /^the "?(.+?)"? directory should exist$/ do |dir_name|
  4. @dir_name = dir_name
  5. assert File.directory?(dir_name), "File.directory?(#{dir_name}) = #{File.directory?(dir_name)}"
  6. end
  7. Then /^the "?(.+?)"? file should exist$/ do |file_name|
  8. @file_name = file_name
  9. assert File.file?(file_name)
  10. end
  11. Then /^it should be owned by (.+?) with group (.+?)$/ do |owner, group|
  12. # TODO
  13. end
  14. Then /^"?(.+?)"? should be a symlink to "?(.+?)"$/ do |link, target|
  15. assert File.symlink?(link)
  16. assert_equal target, File.readlink(link)
  17. end
  18. Then /^it should contain a line matching "(.+?)"$/ do |regexp|
  19. content = File.open(@file_name).read
  20. re = Regexp.new("^#{regexp}$")
  21. assert content =~ re
  22. end