Sha256: f2df32f55b47f7ce26ec58add6e45de29ccd1df92f3b8b680ca46d3d30812d1a

Contents?: true

Size: 1.72 KB

Versions: 3

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"), true)
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

3 entries across 3 versions & 1 rubygems

Version Path
berkshelf-0.3.2 features/step_definitions/cli_steps.rb
berkshelf-0.3.1 features/step_definitions/cli_steps.rb
berkshelf-0.3.0 features/step_definitions/cli_steps.rb