<commit_before>require_relative '../test_helper'
class TestListingMultipleCourseReviews < Minitest::Test

  def test_listing_multiple_reviews_happy_path
    shell_output = ""
    expected_output = ""
    IO.popen('./disc_golf_course_tracker', 'r+') do |pipe|
      expected_output << main_menu
      pipe.puts"1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Seven Oaks Park"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Nashville"
      expected_output << "In what state is the course located?\n"
      pipe.puts "TN"
      expected_output << "Thank you. Seven Oaks Park has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Token Creek"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Madison"
      expected_output << "In what state is the course located?\n"
      pipe.puts "WI"
      expected_output << "Thank you. Token Creek has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "2"
      expected_output << "\nYour Wish List Courses are:\n1. Seven Oaks Park (Nashville, TN)\n2. Token Creek (Madison, WI)\n"
      expected_output << view_courses_submenu
      pipe.puts "3"
      expected_output << "Which course would you like to mark as complete?\n"
      pipe.puts "Token Creek"
      expected_output << "Please enter a quick review of the course.\n"
      pipe.puts "Great Course!"
      expected_output << "Token Creek was successfully marked as completed.\n"
      expected_output << main_menu
      pipe.puts "3"
      expected_output << "\nCompleted Courses:\n\n1. Token Creek (Madison, WI) Reviews: 1\n\nWould you like to...\n1. See all reviews for a course\n2. Add a review to a course\n3. Return to main menu\n"
      pipe.puts "1"
      expected_output << "What is the name of the course for which you want to see reviews?\n"
      pipe.puts ""
      expected_output << "Course not found\n"
      expected_output << main_menu
      pipe.puts "5"
      expected_output << "Goodbye!\n"
      pipe.close_write
      shell_output = pipe.read
    end
    assert_equal expected_output, shell_output
  end

end<commit_msg>added happy path integration test for listing course reviews<commit_after>require_relative '../test_helper'
class TestListingMultipleCourseReviews < Minitest::Test

  def test_listing_multiple_reviews_sad_path
    shell_output = ""
    expected_output = ""
    IO.popen('./disc_golf_course_tracker', 'r+') do |pipe|
      expected_output << main_menu
      pipe.puts"1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Seven Oaks Park"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Nashville"
      expected_output << "In what state is the course located?\n"
      pipe.puts "TN"
      expected_output << "Thank you. Seven Oaks Park has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Token Creek"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Madison"
      expected_output << "In what state is the course located?\n"
      pipe.puts "WI"
      expected_output << "Thank you. Token Creek has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "2"
      expected_output << "\nYour Wish List Courses are:\n1. Seven Oaks Park (Nashville, TN)\n2. Token Creek (Madison, WI)\n"
      expected_output << view_courses_submenu
      pipe.puts "3"
      expected_output << "Which course would you like to mark as complete?\n"
      pipe.puts "Token Creek"
      expected_output << "Please enter a quick review of the course.\n"
      pipe.puts "Great Course!"
      expected_output << "Token Creek was successfully marked as completed.\n"
      expected_output << main_menu
      pipe.puts "3"
      expected_output << "\nCompleted Courses:\n\n1. Token Creek (Madison, WI) Reviews: 1\n\nWould you like to...\n1. See all reviews for a course\n2. Add a review to a course\n3. Return to main menu\n"
      pipe.puts "1"
      expected_output << "What is the name of the course for which you want to see reviews?\n"
      pipe.puts ""
      expected_output << "Course not found\n"
      expected_output << main_menu
      pipe.puts "5"
      expected_output << "Goodbye!\n"
      pipe.close_write
      shell_output = pipe.read
    end
    assert_equal expected_output, shell_output
  end

  def test_listing_multiple_reviews_happy_path
    shell_output = ""
    expected_output = ""
    IO.popen('./disc_golf_course_tracker', 'r+') do |pipe|
      expected_output << main_menu
      pipe.puts"1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Seven Oaks Park"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Nashville"
      expected_output << "In what state is the course located?\n"
      pipe.puts "TN"
      expected_output << "Thank you. Seven Oaks Park has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "1"
      expected_output << "What is the name of the course?\n"
      pipe.puts "Token Creek"
      expected_output << "In what city is the course located?\n"
      pipe.puts "Madison"
      expected_output << "In what state is the course located?\n"
      pipe.puts "WI"
      expected_output << "Thank you. Token Creek has been added to your course Wish List.\n"
      expected_output << main_menu
      pipe.puts "2"
      expected_output << "\nYour Wish List Courses are:\n1. Seven Oaks Park (Nashville, TN)\n2. Token Creek (Madison, WI)\n"
      expected_output << view_courses_submenu
      pipe.puts "3"
      expected_output << "Which course would you like to mark as complete?\n"
      pipe.puts "Token Creek"
      expected_output << "Please enter a quick review of the course.\n"
      pipe.puts "Great Course!"
      expected_output << "Token Creek was successfully marked as completed.\n"
      expected_output << main_menu
      pipe.puts "3"
      expected_output << "\nCompleted Courses:\n\n1. Token Creek (Madison, WI) Reviews: 1\n\nWould you like to...\n1. See all reviews for a course\n2. Add a review to a course\n3. Return to main menu\n"
      pipe.puts "1"
      expected_output << "What is the name of the course for which you want to see reviews?\n"
      pipe.puts "Token Creek"
      expected_output << "\nReviews for Token Creek:\n\nMay 20, 2015 - Great Course!\n\n"
      expected_output << main_menu
      pipe.puts "5"
      expected_output << "Goodbye!\n"
      pipe.close_write
      shell_output = pipe.read
    end
    assert_equal expected_output, shell_output
  end

end
{'fraction_non_alphanumeric': 0.0963382737576286, 'fraction_numerical': 0.006974716652136007, 'mean_word_length': 2.832405345211581, 'pattern_counts': {'":': 0, '<': 137, '<?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': '411770', 'n_tokens_mistral': 2149, 'n_tokens_neox': 2100, 'n_words': 713}