<commit_before>require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier')

describe Flapjack::NotifierOptions do 
 
  before(:each) do 
  end
 
  # beanstalk
  it "should accept the location of a beanstalk queue in short form" do 
    args = %w(-b localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.host.should == "localhost"
  end
  
  it "should accept the location of a beanstalk queue in long form" do 
    args = %w(--beanstalk localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.host.should == "localhost"
  end

  # recipients
  it "should accept the location of a recipients file in short form" do 
    args = %w(-b localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.recipients.should == "spec/recipients.yaml"
  end
  
  it "should accept the location of a recipients file in long form" do 
    args = %w(-b localhost --recipient spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.recipients.should == "spec/recipients.yaml"
  end

  it "should exit if the recipients file doesn't exist" do <commit_msg>added option parsing for beanstalkd port number<commit_after>require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier')

describe Flapjack::NotifierOptions do 
 
  before(:each) do 
  end
 
  # beanstalk
  it "should accept the location of a beanstalk queue in short form" do 
    args = %w(-b localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.host.should == "localhost"
  end
  
  it "should accept the location of a beanstalk queue in long form" do 
    args = %w(--beanstalk localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.host.should == "localhost"
  end

  # beanstalk port
  it "should accept a specified beanstalk port in short form" do 
    args = %w(-b localhost -p 11340 -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.port.should == 11340
  end
  
  it "should accept a specified beanstalk port in long form" do 
    args = %w(-b localhost --port 11399 -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.port.should == 11399
  end

  it "should set a default beanstalk port" do 
    args = %w(-b localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.port.should == 11300
  end

  # recipients
  it "should accept the location of a recipients file in short form" do 
    args = %w(-b localhost -r spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.recipients.should == "spec/recipients.yaml"
  end
  
  it "should accept the location of a recipients file in long form" do 
    args = %w(-b localhost --recipient spec/recipients.yaml)
    options = Flapjack::NotifierOptions.parse(args)
    options.recipients.should == "spec/recipients.yaml"
  end

  it "should exit if the recipients file doesn't exist" do 
{'fraction_non_alphanumeric': 0.10381288048702339, 'fraction_numerical': 0.008010253123998718, 'mean_word_length': 3.5312046444121914, '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': '6861762', 'n_tokens_mistral': 1047, 'n_tokens_neox': 941, 'n_words': 304}