Sha256: f0977145daab0f41747ef8a20216714301bc9c45e132330108493d02d96abd04

Contents?: true

Size: 1.72 KB

Versions: 2

Compression:

Stored size: 1.72 KB

Contents

require 'aruba/api'

World(Aruba::Api)
World(Berkshelf::RSpec::FileSystemMatchers)

Then /^I trace$/ do
end

When /^I sleep$/ do
  sleep 10
end

Then /^a file named "(.*?)" should exist in the current directory$/ do |filename|
  in_current_dir do
    File.exists?(filename).should be_true # not sure why Aruba's
                                          # #check_file_presence
                                          # doesn't work here. It
                                          # looks in the wrong
                                          # directory.
  end
end

Then /^the file "(.*?)" should contain in the current directory:$/ do |filename, string|
  in_current_dir do
    File.read(filename).should match(Regexp.new(string))
  end
end

When /^I run the init command with the cookbook "(.*?)" as the target$/ do |cookbook_name|
  run_simple(unescape("berks init #{cookbook_name}"), true)
end

When /^I run the init command with the directory "(.*?)" as the target$/ do |directory_name|
  run_simple(unescape("berks init #{directory_name}"), true)
end

When /^I run the init command with no value for the target$/ do
  run_simple(unescape("berks init"), true)
end

When /^I run the install command$/ do
  run_simple(unescape("berks install"), false)
end

When /^I run the install command with flags:$/ do |flags|
  run_simple(unescape("berks install #{flags.raw.join(" ")}"), true)
end

When /^I run the update command$/ do
  run_simple(unescape("berks update"), true)
end

When /^I run the upload command$/ do
  run_simple(unescape("berks upload"), true)
end

Then /^the CLI should exit with the status code for error "(.*?)"$/ do |error_constant|
  exit_status = Berkshelf.const_get(error_constant).status_code
  assert_exit_status(exit_status)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
berkshelf-0.3.7 features/step_definitions/cli_steps.rb
berkshelf-0.3.3 features/step_definitions/cli_steps.rb