<commit_before>require File.dirname(__FILE__) + '/../../spec_helper'

describe "ENV.[]" do
  before :each do
    @variable_name = 'USER'
    platform_is :windows do
      @variable_name = 'USERNAME'
    end
  end

  it "returns the specified environment variable" do
    ENV[@variable_name].should == username
  end

  it "returns nil if the variable isn't found" do
    ENV["this_var_is_never_set"].should == nil
  end
end
<commit_msg>ENV.[]: Uses locale encoding on 1.9<commit_after>require File.dirname(__FILE__) + '/../../spec_helper'

describe "ENV.[]" do
  before :each do
    @variable_name = 'USER'
    platform_is :windows do
      @variable_name = 'USERNAME'
    end
  end

  it "returns the specified environment variable" do
    ENV[@variable_name].should == username
  end

  it "returns nil if the variable isn't found" do
    ENV["this_var_is_never_set"].should == nil
  end

  ruby_version_is "1.9" do
    it "uses the locale encoding" do
      ENV[@variable_name].encoding.should == Encoding.find('locale')
    end
  end
end

{'fraction_non_alphanumeric': 0.11516314779270634, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 3.327800829875519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5155081', 'n_tokens_mistral': 344, 'n_tokens_neox': 324, 'n_words': 100}