Sha256: 70c176c201cd7bb4290dd916af41b73cec63385dab8c87535673fe02b4cca4eb
Contents?: true
Size: 737 Bytes
Versions: 39
Compression:
Stored size: 737 Bytes
Contents
#!/usr/bin/env ruby $: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')) $: << File.expand_path(File.dirname(__FILE__)) require 'rspec/expectations' require 'cucumber/chef' class CustomWorld include Cucumber::Chef end World do CustomWorld.new end Around('@invalid_credentials') do |scenario, block| # Move current working directory if one exists (and restore at end) FileUtils.mv(".chef", ".chef_cucumber_temp") if File.exist?(".chef") FileUtils.mkdir_p(".chef") config = "chef_node_name 'REALLYBOGUSORGNAME'" File.open(".chef/knife.rb", 'w') { |f| f.puts config } block.call FileUtils.rm_rf(".chef") FileUtils.mv(".chef_cucumber_temp", ".chef") if File.exist?(".chef_cucumber_temp") end
Version data entries
39 entries across 39 versions & 1 rubygems