<commit_before>require 'minitest/autorun'
require 'rubygems'
require 'bundler/setup'

class TestCheersIntegration < Minitest::Test

#Sample test
  def test_00_that_the_tests_run
    assert_equal true, true
  end

#Valid arguments
  def test_01_zero_args_help_message
    output = `./cheers.rb`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid date must accompany name
  def test_02_one_arg_with_valid_name
    output = `./cheers.rb Bill`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid name must accompany birthday
  def test_03_1_arg_w_birthday_and_no_name
    output = `./cheers.rb 04301960`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments needed
  def test_04_1_arg_all_non_words
    output = `./cheers.rb @@@@@ @@@@@@@@`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments must accompany run command of './cheers'
  def test_05_1_arg_cheers_all_non_words
    output = `./cheers.rb 77777 @@@@@@@@`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Date validation
  def test_06_date_validation
    output = `./cheers.rb Bill 99999999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_07_2_args_name_and_date_with_this_year
    output = `./cheers.rb Bill 04302015`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_08_3_args_ignore_extra_args
    output = `./cheers.rb Bill 1129 Chattanooga`
    expected = <<EOS
Give me a... B
Give me an... I
Give me an... L
Give me an... L
Hi, Bill. There are 230 days until your birthday."
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_09_2_args_invalid_invalid
    output = `./cheers.rb 77777 99999999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_10_2_args_invalid_valid
    output = `./cheers.rb 777777 04301960`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_11_2_args_valid_invalid
    output = `./cheers.rb Bill 99999999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments - produce message
  def test_12_2_args_valid_valid
    expected = `./cheers.rb Mike 1129`
    output = "Hi, John. There are 210 days until your birthday."
    assert_equal expected, output
  end
end<commit_msg>Debugging of cheers.rb<commit_after>require 'minitest/autorun'
require 'rubygems'
require 'bundler/setup'

class TestCheersIntegration < Minitest::Test

#Sample test
  def test_00_that_the_tests_run
    assert_equal true, true
  end

#Valid arguments
  def test_01_zero_args_help_message
    output = `./cheers.rb`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid date must accompany name
  def test_02_one_arg_with_valid_name
    output = `./cheers.rb Bill`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid name must accompany birthday
  def test_03_1_arg_w_birthday_and_no_name
    output = `./cheers.rb 0430`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments needed
  def test_04_1_arg_all_non_words
    output = `./cheers.rb @@@@@ @@@@`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments must accompany run command of './cheers'
  def test_05_1_arg_cheers_all_non_words
    output = `./cheers.rb 77777 @@@@`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Date validation
  def test_06_date_validation
    output = `./cheers.rb Bill 9999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_07_2_args_name_and_date_with_this_year
    output = `./cheers.rb Bill 0430`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_08_3_args_ignore_extra_args
    output = `./cheers.rb Bill 1129 Chattanooga`
    expected = <<EOS
Give me a... B
Give me an... I
Give me an... L
Give me an... L
Hi, Bill. There are 230 days until your birthday."
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_09_2_args_invalid_invalid
    output = `./cheers.rb 77777 9999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_10_2_args_invalid_valid
    output = `./cheers.rb 777777 0430`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments
  def test_11_2_args_valid_invalid
    output = `./cheers.rb Mike 9999`
    expected = <<EOS
Please enter your name and your birthday.
Try again with `./cheers.rb [Name] [MM/DD Birthday]`
EOS
    assert_equal expected, output
  end

#Valid arguments - produce message
  def test_12_2_args_valid_valid
    expected = `./cheers.rb Mike 1129`
    output = "Hi, Mike. There are 210 days until your birthday."
    assert_equal expected, output
  end
end
{'fraction_non_alphanumeric': 0.08960359012715034, 'fraction_numerical': 0.030216903515332835, 'mean_word_length': 3.5794520547945203, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, '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': '1533385', 'n_tokens_mistral': 2389, 'n_tokens_neox': 2252, 'n_words': 759}