class ChefSpec::ZeroServer
def reset!
Remove all the data we just loaded from the ChefZero server
def reset! if RSpec.configuration.server_runner_clear_cookbooks @server.clear_data @cookbooks_uploaded = false else # If we don't want to do a full clear, iterate through each value that we # set and manually remove it. @data_loaded.each do |key, names| if key == "data" names.each { |n| @server.data_store.delete_dir(["organizations", "chef", key, n]) } else names.each { |n| @server.data_store.delete(["organizations", "chef", key, n]) } end end end @data_loaded = {} end