rlmoser99 / ruby_rspec_TOP

A tutorial that I developed for students at The Odin Project to learn RSpec.

Home Page:https://github.com/TheOdinProject/ruby_testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test the 'Script'

rlmoser99 opened this issue · comments

Per timato's convseration with aaron-contreras in Discord on 8/3/20. What is the best way to teach/instruct students to test their Game 'Script'.

The lesson to address this issue in this playground is in 15a_binary_game. The 'script' is:

def start
    game_instructions
    mode = game_mode_selection(mode_input)
    mode == 1 ? user_random : computer_random
    computer_turns
end

Based on my understanding. We have two choices.

  1. Leave the example as it is (inside the class) and explain that all of the method calls inside this method should be treated as if they are incoming messages.
  2. Move this 'script' outside of the class to a main file. Explain why this script actually belongs outside of the object. Test all method calls because they are actually then incoming messages.