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

describe "AwesomePrint" do
  describe "colorization" do
    PLAIN = '[ 1, :two, "three", [ nil, [ true, false ] ] ]'
    COLORIZED = "[ \e[1;34m1\e[0m, \e[0;36m:two\e[0m, \e[0;33m\"three\"\e[0m, [ \e[1;31mnil\e[0m, [ \e[1;32mtrue\e[0m, \e[1;31mfalse\e[0m ] ] ]"

    before(:each) do
      AwesomePrint.force_colors!(false)
      ENV['TERM'] = "xterm-colors"
      ENV.delete('ANSICON')
      @arr = [ 1, :two, "three", [ nil, [ true, false] ] ]
    end
    
    it "colorizes tty processes by default" do
      stub_tty!(STDOUT, true)<commit_msg>Use stub_dotfile! in colorization specs to make them unaffected by ~/.aprc customizations<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "AwesomePrint" do
  before(:each) do
    stub_dotfile!
  end

  describe "colorization" do
    PLAIN = '[ 1, :two, "three", [ nil, [ true, false ] ] ]'
    COLORIZED = "[ \e[1;34m1\e[0m, \e[0;36m:two\e[0m, \e[0;33m\"three\"\e[0m, [ \e[1;31mnil\e[0m, [ \e[1;32mtrue\e[0m, \e[1;31mfalse\e[0m ] ] ]"

    before(:each) do
      AwesomePrint.force_colors!(false)
      ENV['TERM'] = "xterm-colors"
      ENV.delete('ANSICON')
      @arr = [ 1, :two, "three", [ nil, [ true, false] ] ]
    end
    
    it "colorizes tty processes by default" do
      stub_tty!(STDOUT, true)
{'fraction_non_alphanumeric': 0.18722786647314948, 'fraction_numerical': 0.03918722786647315, 'mean_word_length': 3.322884012539185, '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': '1748974', 'n_tokens_mistral': 604, 'n_tokens_neox': 565, 'n_words': 106}