spec/instance_spec.rb
# Creates a test recipe file and runs a block before destroying the file
Creates a test recipe file and runs a block before destroying the file
Creates a test recipe file and runs a block before destroying the file
def apply_recipe(recipe)
    recipe_name = "recipe~test~#{(0...8).map { (65 + rand(26)).chr }.join}"
    recipe_loc = File.join(File.dirname(__FILE__), '..', 'recipes',
                           "#{recipe_name}.rb")
    File.open(recipe_loc, 'w') do |file|
      file.write([build_cred, recipe].join("\n"))
    end
    recipe_path = "google-gsql::#{recipe_name}"
    begin
      yield recipe_path
    ensure
      File.delete(recipe_loc)
    end
  end
def apply_recipe ( recipe ) recipe_name = "recipe~test~#{(0...8).map { (65 + rand(26)).chr }.join}" recipe_loc = File . join ( File . dirname ( __FILE__ ) , '..' , 'recipes' , "#{recipe_name}.rb" ) File . open ( recipe_loc , 'w' ) do | file | file . write ( [ build_cred , recipe ] . join ( "\n" ) ) end recipe_path = "google-gsql::#{recipe_name}" begin yield recipe_path ensure File . delete ( recipe_loc ) end end
Creates a test recipe file and runs a block before destroying the file
Creates a test recipe file and runs a block before destroying the file
# Creates a random string name
recipe
<not_specific>