The Emperor has commissioned you to build a Gladiator Arena. Your life depends on developing a well-thought-out arena, so you have been given tests to make sure you build it well.
- In the gladiator folder, run
bundle install
to make sure you have the right gems installed - Run
rspec
to run your tests. They should all fail. - Start with the
Gladiator
tests / class (see steps below) - Then do the
Arena
tests / class (see steps below)
For each individual test:
- Read the error message.
- Make the smallest change in your code to fix the error.
- Run the test.
- Repeat 1 - 3 until the test passes
- Move to the next test.
Try writing the tests yourself:
$ rm -rf spec
- A gladiator has a name
- A gladiator has a weapon (one of Spear, Club, Trident)
- An arena has a name
- The name should be capitalized
- An arena can have gladiators
- You can add a gladiator to the arena
- The arena should never have more than 2 gladiators in it at a time
- If there are two gladiators in the arena, you can call a fight method that results in the elimination of one of the gladiators from the arena.
- Winning conditions:
- Trident beats Spear
- Spear beats Club
- Club beats Trident
- If the two gladiators have the same weapon, they are both eliminated.
- Winning conditions:
Note: No tests are provided for this bonus. You can either just add the functionality w/o tests, or try to write the tests yourself.
- Add a method to remove gladiators from the arena by name
- Update your winning conditions so that if the gladiator named "Maximus" is in the fight, he wins.
- Add a method to check to see if the crowd is entertained (
.entertained?
). The crowd is only entertained if Maximus is in the arena. - Before a losing gladiator is eliminated, the user should be prompted to put their thumbs up or down. If user votes down, the losing gladiator is removed. If the user votes up, the gladiator stays in the arena and his opponent is removed. (Life isn't fair.)