This is a collection of the standard Turing Mythical Creatures exercises with a few...obfuscations thrown in.
Specifically, these creatures are "completed" and, in theory, correct. But each one has one or more subtle bugs introduced!
Your job is to use the test suite, error messages, and tools like Pry to fix the mistakes.
git clone git@github.com:turingschool-examples/erroneous_creatures.git
unicorn_test.rb
vampire_test.rb
dragon_test.rb
hobbit_test.rb
pirate_test.rb
wizard_test.rb
medusa_test.rb
werewolf_test.rb
centaur_test.rb
hippogriff_test.rb
Here are some of the kinds of errors you can expect to find:
- Syntax errors (files won't run)
- Misuse of local / instance variables
- Misuse of boolean types / object truthiness
- Mixing variable assignment and boolean comparison
- Mixing of collection and single-object types
- Probably many more!
Remember the techniques we have at our disposal:
- Use the test suite to get rapid feedback about our code
- Use Pry to verify assumptions about code, especially verifying values of variables and types of objects
- Use stacktraces and error messages to understand and zero in on errors
- Read each stacktrace twice before trying to change any code
mrspec .
or
rake
or running individual tests using ruby
:
ruby unicorn_test.rb
Meant to be used in combination with the Debugging Techniques Lesson Plan.