exercise: Bob version: 2 plan: 28 methods: hey tests: |- # Go through the cases and check that Bob gives us the correct responses. is ::($exercise).?hey(.), |. for @($c-data); exercise_comment: The name of this exercise. module_comment: The name of the module file to be loaded. version_comment: The version we will be matching against the exercise. lib_comment: Look for the module inside the same directory as this test file. plan_comment: This is how many tests we expect to run. use_test_comment: Check that the module can be use-d. version_test_comment: "If the exercise is updated, we want to make sure other people testing\nyour code don't think you've made a mistake if things have changed!" methods_comment: "Check that the class 'Bob' can use all of the methods\nneeded in the tests (only 'hey' for this one)." exercism_comment: "Don't worry about the stuff below here for your exercise.\nThis is for Exercism folks to check that everything is in order." unit: class unit_comment: |- #`[ Declare class 'Bob' with version and unit-scope the class i.e. everything in this file is part of 'Bob'. ] example: |- method hey ( Str:D $_ --> Str:D ) { my \shouting = /<:L>/ ^ /<:Ll>/; given .trim { when .ends-with: ‘?’ { when shouting { ‘Calm down, I know what I'm doing!’ } default { ‘Sure.’ } } when shouting { ‘Whoa, chill out!’ } when .not { ‘Fine. Be that way!’ } default { ‘Whatever.’ }; } } stub: |- method hey ($msg) { #`[ Remove the comments and write some code here to pass the test suite. You can experiment with the code outside of this block, but no changes are needed for the test suite to pass. ] }