You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: with_settings.rb
    path of file: ./repos/openproject/spec/support/shared
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Re
    
  def stub_configuration_yml
    # disable test env detection because loading of the config file is partially disabled in test env
    allow(Rails.env).to receive(:test?).and_return(false)
    allow(File)
      .to receive(:file?)
            .with(Rails.root.join('config/configuration.yml'))
            .and_return(true)

    # It is added to avoid warning about other File.read calls.
    allow(File).to receive(:read).and_call_original
    allow(File)
      .to receive(:read)
            .with(Rails.root.join('config/configuration.yml'))
            .and_return(configuration_yml)
  end