From 6113561131862438c2411a65491bb67db6fc2f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Britto?= Date: Sun, 18 Jun 2017 09:13:56 -0300 Subject: [PATCH 1/3] bowling 1.0.1: can_not -> cannot in descriptions https://github.com/exercism/problem-specifications/pull/832 --- exercises/bowling/Cargo.toml | 2 +- exercises/bowling/tests/bowling.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/bowling/Cargo.toml b/exercises/bowling/Cargo.toml index 37fd6f1cc..d5072fb75 100644 --- a/exercises/bowling/Cargo.toml +++ b/exercises/bowling/Cargo.toml @@ -1,3 +1,3 @@ [package] name = "bowling" -version = "1.0.0" +version = "1.0.1" diff --git a/exercises/bowling/tests/bowling.rs b/exercises/bowling/tests/bowling.rs index cb9541bbf..a2a395cfe 100644 --- a/exercises/bowling/tests/bowling.rs +++ b/exercises/bowling/tests/bowling.rs @@ -10,7 +10,7 @@ fn roll_returns_a_result() { #[test] #[ignore] -fn you_can_not_roll_more_than_ten_pins_in_a_single_roll() { +fn you_cannot_roll_more_than_ten_pins_in_a_single_roll() { let mut game = BowlingGame::new(); assert_eq!(game.roll(11), Err(Error::NotEnoughPinsLeft));; @@ -31,7 +31,7 @@ fn a_game_score_is_some_if_ten_frames_have_been_rolled() { #[test] #[ignore] -fn you_can_not_score_a_game_with_no_rolls() { +fn you_cannot_score_a_game_with_no_rolls() { let game = BowlingGame::new(); assert_eq!(game.score(), None); @@ -279,7 +279,7 @@ fn all_strikes_is_a_perfect_score_of_300() { #[test] #[ignore] -fn you_can_not_roll_more_than_ten_pins_in_a_single_frame() { +fn you_cannot_roll_more_than_ten_pins_in_a_single_frame() { let mut game = BowlingGame::new(); assert!(game.roll(5).is_ok()); @@ -288,7 +288,7 @@ fn you_can_not_roll_more_than_ten_pins_in_a_single_frame() { #[test] #[ignore] -fn first_bonus_ball_after_a_final_strike_can_not_score_an_invalid_number_of_pins() { +fn first_bonus_ball_after_a_final_strike_cannot_score_an_invalid_number_of_pins() { let mut game = BowlingGame::new(); for _ in 0..18 { @@ -302,7 +302,7 @@ fn first_bonus_ball_after_a_final_strike_can_not_score_an_invalid_number_of_pins #[test] #[ignore] -fn the_two_balls_after_a_final_strike_can_not_score_an_invalid_number_of_pins() { +fn the_two_balls_after_a_final_strike_cannot_score_an_invalid_number_of_pins() { let mut game = BowlingGame::new(); for _ in 0..18 { @@ -332,7 +332,7 @@ fn the_two_balls_after_a_final_strike_can_be_a_strike_and_non_strike() { #[test] #[ignore] -fn the_two_balls_after_a_final_strike_can_not_be_a_non_strike_followed_by_a_strike() { +fn the_two_balls_after_a_final_strike_cannot_be_a_non_strike_followed_by_a_strike() { let mut game = BowlingGame::new(); for _ in 0..18 { @@ -347,7 +347,7 @@ fn the_two_balls_after_a_final_strike_can_not_be_a_non_strike_followed_by_a_stri #[test] #[ignore] -fn second_bonus_ball_after_a_final_strike_can_not_score_an_invalid_number_of_pins_even_if_first_is_strike( +fn second_bonus_ball_after_a_final_strike_cannot_score_an_invalid_number_of_pins_even_if_first_is_strike( ) { let mut game = BowlingGame::new(); @@ -363,7 +363,7 @@ fn second_bonus_ball_after_a_final_strike_can_not_score_an_invalid_number_of_pin #[test] #[ignore] -fn if_the_last_frame_is_a_strike_you_can_not_score_before_the_extra_rolls_are_taken() { +fn if_the_last_frame_is_a_strike_you_cannot_score_before_the_extra_rolls_are_taken() { let mut game = BowlingGame::new(); for _ in 0..18 { @@ -385,7 +385,7 @@ fn if_the_last_frame_is_a_strike_you_can_not_score_before_the_extra_rolls_are_ta #[test] #[ignore] -fn if_the_last_frame_is_a_spare_you_can_not_create_a_score_before_extra_roll_is_taken() { +fn if_the_last_frame_is_a_spare_you_cannot_create_a_score_before_extra_roll_is_taken() { let mut game = BowlingGame::new(); for _ in 0..18 { From cf813a7a2ab92df2643edd9ab7068a52771e010d Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Mon, 19 Nov 2018 00:43:28 +0000 Subject: [PATCH 2/3] bowling: no-op declare compliance with 1.1.0 move inputs to `input` object, change `previous_rolls` to `previousRolls` https://github.com/exercism/problem-specifications/pull/1088 --- exercises/bowling/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/bowling/Cargo.toml b/exercises/bowling/Cargo.toml index d5072fb75..efbcd8e73 100644 --- a/exercises/bowling/Cargo.toml +++ b/exercises/bowling/Cargo.toml @@ -1,3 +1,3 @@ [package] name = "bowling" -version = "1.0.1" +version = "1.1.0" From 191de1a61a85064d5e0ce62a8608c72e782e55fd Mon Sep 17 00:00:00 2001 From: Corey McCandless Date: Mon, 12 Feb 2018 14:19:08 -0600 Subject: [PATCH 3/3] bowling 1.2.0: Test rolling after bonus rolls Currently, there are no tests confirming that a game with bonus rolls for a spare or strike in the 10th frame is complete. This PR adds a case for both spare and strike, attempting to roll an additional ball after the bonus rolls have been completed, expecting an error to be raised upon the roll attempt. https://github.com/exercism/problem-specifications/pull/1189 --- exercises/bowling/Cargo.toml | 2 +- exercises/bowling/tests/bowling.rs | 32 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/exercises/bowling/Cargo.toml b/exercises/bowling/Cargo.toml index efbcd8e73..3ef65f2ad 100644 --- a/exercises/bowling/Cargo.toml +++ b/exercises/bowling/Cargo.toml @@ -1,3 +1,3 @@ [package] name = "bowling" -version = "1.1.0" +version = "1.2.0" diff --git a/exercises/bowling/tests/bowling.rs b/exercises/bowling/tests/bowling.rs index a2a395cfe..fb628d5a7 100644 --- a/exercises/bowling/tests/bowling.rs +++ b/exercises/bowling/tests/bowling.rs @@ -401,3 +401,35 @@ fn if_the_last_frame_is_a_spare_you_cannot_create_a_score_before_extra_roll_is_t assert!(game.score().is_some()); } + +#[test] +#[ignore] +fn cannot_roll_after_bonus_roll_for_spare() { + let mut game = BowlingGame::new(); + + for _ in 0..9 { + let _ = game.roll(0); + let _ = game.roll(0); + } + let _ = game.roll(7); + let _ = game.roll(3); + assert!(game.roll(2).is_ok()); + + assert_eq!(game.roll(2), Err(Error::GameComplete)); +} + +#[test] +#[ignore] +fn cannot_roll_after_bonus_roll_for_strike() { + let mut game = BowlingGame::new(); + + for _ in 0..9 { + let _ = game.roll(0); + let _ = game.roll(0); + } + let _ = game.roll(10); + let _ = game.roll(3); + assert!(game.roll(2).is_ok()); + + assert_eq!(game.roll(2), Err(Error::GameComplete)); +}