Sha256: 2085ce164295e25fc66f25d5858c92af484dfe8dcf1f6562f4d25377102b49a6

Contents?: true

Size: 1.88 KB

Versions: 8

Compression:

Stored size: 1.88 KB

Contents

Given /^a Cookbook path "([^"]*)"$/ do |dir_name|
  create_dir(dir_name)
  in_dir do
    update_cookbook_paths(dir_name, true)
  end
end

Given /^a Cookbooks path "([^"]*)"$/ do |dir_name|
  create_dir(dir_name)
  in_dir do
    update_cookbook_paths(dir_name, false)
  end
end

Then /^the local Cookbook "([^"]*)" exists$/ do |ckbk|
  chef.cookbook_paths.each do |pn|
    curr_ckbk = pn.basename.to_s
    if curr_ckbk == ckbk
      break true if curr_ckbk.should == ckbk
    end
  end
  #TODO: check_file_presence([file], true), etc.
end

Given /^the local Cookbook repository "([^"]*)"$/ do |ckbk_repo|
  in_dir do
    repo = Dir.exist?(ckbk_repo) ? Pathname(ckbk_repo).expand_path.realdirpath : ckbk_repo
    chef.local_cookbook_repo = repo
  end
end

Then /^the local Cookbook repository exists$/ do
  chef.local_cookbook_repo.exist?.should be_true
  #TODO: check_file_presence([file], true), etc.
end

Then /^the local Site\-Cookbook "([^"]*)" exists$/ do |ckbk|
  ckbk_path = 'site-cookbook'
  chef.cookbook_paths.each do |pn|
    curr_ckbk = pn.basename.to_s
    if pn.to_s[/#{ckbk_path}}/] && curr_ckbk == ckbk
      break true if curr_ckbk.should == ckbk
    end
  end
  #TODO: check_file_presence([file], true), etc.
end

Then /^the local Site\-Cookbook repository exists$/ do
  chef.local_site_cookbook_repo.exist?.should be_true
  #TODO: check_file_presence([file], true), etc.
end

And /^these local Cookbooks exist:$/ do |table|
  check_cookbook_table_presence(table)
end

And /^these local Cookbooks do not exist:$/ do |table|
  check_cookbook_table_presence(table, false)
end

And /^these local Site\-Cookbooks exist:$/ do |table|
  ckbk_path = 'site-cookbook'
  table.hashes.each do |hsh|
    chef.cookbook_paths.each do |pn|
      curr_ckbk = pn.basename.to_s
      if pn.to_s[/#{ckbk_path}}/] && curr_ckbk == hsh['cookbook']
        break true if curr_ckbk.should == hsh['cookbook']
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cuken-0.1.22 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.21 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.20 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.19 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.18 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.17 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.16 lib/cuken/cucumber/chef/cookbook/local.rb
cuken-0.1.15 lib/cuken/cucumber/chef/cookbook/local.rb