<commit_before>require 'spec_helper'

describe Redimap::Config do
  
  context "Defaults" do
    before(:each) do
      ENV.stub(:[])
      
      @config = Redimap::Config.new
    end
    
    it "imap_port should default to 993" do
      @config.imap_port.should == 993
    end
    
    it "imap_mailboxes should default to [INBOX]" do
      @config.imap_mailboxes.should == ['INBOX']
    end
    
    it "redis_url should default to redis://127.0.0.1:6379/0" do
      @config.redis_url.should == "redis://127.0.0.1:6379/0"
    end
    
    it "redis_ns_redimap should default to redimap" do
      @config.redis_ns_redimap.should == "redimap"
    end
    
    it "redis_ns_queue should default to resque" do
      @config.redis_ns_queue.should == "resque"
    end
    
    it "redis_ns_queue should default to 60 seconds" do
      @config.polling_interval.should == 60
    end
  end
  
  context "Non-defaults" do
    before(:each) do
      ENV.stub(:[]).with("IMAP_HOST").and_return("imap.carrot.localhost")
      ENV.stub(:[]).with("IMAP_PORT").and_return(666)
      ENV.stub(:[]).with("IMAP_USERNAME").and_return("Pachelbel")<commit_msg>[#1] Fix config tests typo.<commit_after>require 'spec_helper'

describe Redimap::Config do
  
  context "Defaults" do
    before(:each) do
      ENV.stub(:[])
      
      @config = Redimap::Config.new
    end
    
    it "imap_port should default to 993" do
      @config.imap_port.should == 993
    end
    
    it "imap_mailboxes should default to [INBOX]" do
      @config.imap_mailboxes.should == ['INBOX']
    end
    
    it "redis_url should default to redis://127.0.0.1:6379/0" do
      @config.redis_url.should == "redis://127.0.0.1:6379/0"
    end
    
    it "redis_ns_redimap should default to redimap" do
      @config.redis_ns_redimap.should == "redimap"
    end
    
    it "redis_ns_queue should default to resque" do
      @config.redis_ns_queue.should == "resque"
    end
    
    it "polling_interval should default to 60 seconds" do
      @config.polling_interval.should == 60
    end
  end
  
  context "Non-defaults" do
    before(:each) do
      ENV.stub(:[]).with("IMAP_HOST").and_return("imap.carrot.localhost")
      ENV.stub(:[]).with("IMAP_PORT").and_return(666)
      ENV.stub(:[]).with("IMAP_USERNAME").and_return("Pachelbel")
{'fraction_non_alphanumeric': 0.12956521739130436, 'fraction_numerical': 0.030869565217391304, 'mean_word_length': 2.747557003257329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3722512', 'n_tokens_mistral': 881, 'n_tokens_neox': 837, 'n_words': 171}