def converge(*recipe_names)
      # Re-apply the Chef config before converging in case something else
      # called Config.reset too.
      apply_chef_config!
      @converging = false
      node.run_list.reset!
      recipe_names.each { |recipe_name| node.run_list.add(recipe_name) }

      return self if dry_run?

      # Expand the run_list
      expand_run_list!

      # Merge in provided node attributes. Default and override use the role_
      # levels so they win over the relevant bits from cookbooks since otherwise
      # they would not and that would be confusing.
      node.attributes.role_default = Chef::Mixin::DeepMerge.merge(node.attributes.role_default, options[:default_attributes]) if options[:default_attributes]
      node.attributes.normal = Chef::Mixin::DeepMerge.merge(node.attributes.normal, options[:normal_attributes]) if options[:normal_attributes]
      node.attributes.role_override = Chef::Mixin::DeepMerge.merge(node.attributes.role_override, options[:override_attributes]) if options[:override_attributes]
      node.attributes.automatic = Chef::Mixin::DeepMerge.merge(node.attributes.automatic, options[:automatic_attributes]) if options[:automatic_attributes]

      # Setup the run_context, rescuing the exception that happens when a
      # resource is not defined on a particular platform
      begin
        @run_context = client.setup_run_context
      rescue Chef::Exceptions::NoSuchResourceType => e
        raise Error::MayNeedToSpecifyPlatform.new(original_error: e.message)
      end

      # Allow stubbing/mocking after the cookbook has been compiled but before the converge
      yield node if block_given?

      @converging = true
      converge_val = @client.converge(@run_context)
      if converge_val.is_a?(Exception)
        raise converge_val
      end
      self
    end
def converge(*recipe_names)
      # Re-apply the Chef config before converging in case something else
      # called Config.reset too.
      apply_chef_config!
      @converging = false
      node.run_list.reset!
      recipe_names.each { |recipe_name| node.run_list.add(recipe_name) }

      return self if dry_run?

      # Expand the run_list
      expand_run_list!

      # Merge in provided node attributes. Default and override use the role_
      # levels so they win over the relevant bits from cookbooks since otherwise
      # they would not and that would be confusing.
      node.attributes.role_default = Chef::Mixin::DeepMerge.merge(node.attributes.role_default, options[:default_attributes]) if options[:default_attributes]
      node.attributes.normal = Chef::Mixin::DeepMerge.merge(node.attributes.normal, options[:normal_attributes]) if options[:normal_attributes]
      node.attributes.role_override = Chef::Mixin::DeepMerge.merge(node.attributes.role_override, options[:override_attributes]) if options[:override_attributes]
      node.attributes.automatic = Chef::Mixin::DeepMerge.merge(node.attributes.automatic, options[:automatic_attributes]) if options[:automatic_attributes]

      # Setup the run_context, rescuing the exception that happens when a
      # resource is not defined on a particular platform
      begin
        @run_context = client.setup_run_context
      rescue Chef::Exceptions::NoSuchResourceType => e
        raise Error::MayNeedToSpecifyPlatform.new(original_error: e.message)
      end

      # Allow stubbing/mocking after the cookbook has been compiled but before the converge
      yield node if block_given?

      @converging = true
      converge_val = @client.converge(@run_context)
      if converge_val.is_a?(Exception)
        raise converge_val
      end
      self
    end
Instantiate a new SoloRunner to run examples with.

 @example Instantiate a new Runner
   ChefSpec::SoloRunner.new

 @example Specifying the platform and version
   ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '18.04')

 @example Specifying the cookbook path
   ChefSpec::SoloRunner.new(cookbook_path: ['/cookbooks'])

 @example Specifying the log level
   ChefSpec::SoloRunner.new(log_level: :info)


 @param [Hash] options
   The options for the new runner

 @option options [Symbol] :log_level
   The log level to use (default is :warn)
 @option options [String] :platform
   The platform to load Ohai attributes from (must be present in fauxhai)
 @option options [String] :version
   The version of the platform to load Ohai attributes from (must be present in fauxhai)
 @option options [String] :path
   Path of a json file that will be passed to fauxhai as :path option
 @option options [Array<String>] :step_into
   The list of LWRPs to evaluate
 @option options String] :file_cache_path
   File caching path, if absent ChefSpec will use a temporary directory generated on the fly

 @yield [node] Configuration block for Chef::Node


 Execute the given `run_list` on the node, without actually converging
 the node. Each time {#converge} is called, the `run_list` is reset to the
 new value (it is **not** additive).

 @example Converging a single recipe
   chef_run.converge('example::default')

 @example Converging multiple recipes
   chef_run.converge('example::default', 'example::secondary')


 @param [Array] recipe_names
   The names of the recipe or recipes to converge

 @return [ChefSpec::SoloRunner]
   A reference to the calling Runner (for chaining purposes)