<commit_before>require "spec_helper"

describe "a settings fallback" do
  it "for example, you can fall back to a setting on disk" do
    settings = Settings.new do
      with_settings :chain => [EnvironmentSettings, BasicDiskSettings]
    end

    ENV.clear

    BasicDiskSettings.new do
      clear
      set :jazzs_bike_shorts => "tight"
    end

    expect(settings.jazzs_bike_shorts).to eql "tight"
  end

  it "by default you get environment settings only"
end<commit_msg>you get the environment setting when it exists<commit_after>require "spec_helper"

describe "a settings fallback" do
  before do
    ENV.clear

    BasicDiskSettings.new do
      clear
      set :jazzs_bike_shorts => "tight"
    end
  end

  let(:settings) do 
    Settings.new do
      with_settings :chain => [EnvironmentSettings, BasicDiskSettings]
    end
  end

  it "for example, you can fall back to a setting on disk" do
    expect(settings.jazzs_bike_shorts).to eql "tight"
  end

  it "you get the environment setting when it exists" do
    ENV["jazzs_bike_shorts"] = "this is from the environment variables"

    expect(settings.jazzs_bike_shorts).to eql "this is from the environment variables"
  end
end
{'fraction_non_alphanumeric': 0.0678391959798995, 'fraction_numerical': 0.0, 'mean_word_length': 3.4095940959409594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '370275', 'n_tokens_mistral': 385, 'n_tokens_neox': 365, 'n_words': 127}