Sha256: 9766145f7c09a3276f88183f1570101bec9bd51b6dc5c10eeb8ce3c38ff38f9f

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

require "tempfile"

Given /^I already have a Berkshelf config file$/ do
  path   = Tempfile.new("berkshelf").path
  config = Berkshelf::Config.new(path)
  config.save

  Berkshelf.config = config

  ENV["BERKSHELF_CONFIG"] = path
  set_environment_variable "BERKSHELF_CONFIG", path
end

Given /^I have a Berkshelf config file containing:$/ do |contents|
  path = Berkshelf.config.path
  FileUtils.mkdir_p(Pathname.new(path).dirname.to_s)

  File.open(path, "w+") { |f| f.write(contents) }

  Berkshelf.config = Berkshelf::Config.from_file(path)
end

Then /^a Berkshelf config file should exist and contain:$/ do |table|
  # Have to reload the config...
  Berkshelf.config.reload

  check_file_presence([Berkshelf.config.path], true)

  table.raw.each do |key, value|
    if value == "BOOLEAN[true]"
      value = true
    end
    expect(Berkshelf.config[key]).to eq(value)
  end
end

Then /^a Berkshelf config file should exist at "(.+)" and contain:$/ do |path, table|
  check_file_presence([path], true)

  path             = File.join(@dirs.first, path)
  Berkshelf.config = Berkshelf::Config.from_file(path)

  table.raw.each do |key, value|
    expect(Berkshelf.config[key]).to eq(value)
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
berkshelf-7.0.7 features/step_definitions/config_steps.rb
berkshelf-6.3.4 features/step_definitions/config_steps.rb
berkshelf-7.0.6 features/step_definitions/config_steps.rb
berkshelf-7.0.5 features/step_definitions/config_steps.rb
berkshelf-6.3.3 features/step_definitions/config_steps.rb
berkshelf-7.0.4 features/step_definitions/config_steps.rb
berkshelf-7.0.3 features/step_definitions/config_steps.rb
berkshelf-7.0.2 features/step_definitions/config_steps.rb
berkshelf-7.0.1 features/step_definitions/config_steps.rb
berkshelf-7.0.0 features/step_definitions/config_steps.rb
berkshelf-6.3.2 features/step_definitions/config_steps.rb
berkshelf-6.3.1 features/step_definitions/config_steps.rb
berkshelf-6.3.0 features/step_definitions/config_steps.rb
berkshelf-6.2.2 features/step_definitions/config_steps.rb
berkshelf-6.2.1 features/step_definitions/config_steps.rb
berkshelf-6.2.0 features/step_definitions/config_steps.rb
berkshelf-6.1.1 features/step_definitions/config_steps.rb
berkshelf-6.1.0 features/step_definitions/config_steps.rb
berkshelf-6.0.1 features/step_definitions/config_steps.rb
berkshelf-6.0.0 features/step_definitions/config_steps.rb