A TDD challenge exploring inheritance, OOP & reviewing broken code
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
Gemfile
Gemfile.lock
README.md

README.md

Fix The Apple Tree TDD

Skill Level: Beginner

The tree.rb script is incomplete. The script should model an apple tree that grows over the years. We should create/plant it, wait for it to bear fruit, pick the fruit and then eventually the tree should die.

Instructions

  • Run your tests: bundle exec rspec
  • Fix the issues that surface
  • Before you begin working on a method, think about what it should return and write it's test first

NOTE: Uncomment the tree_data method at the end of your file and if your script has been crafted correctly, it should print some information about your tree and its fruit.

Considerations

  • What does super do?
  • What's the difference between attr_reader, attr_writer or attr_accessor?
  • How does inheritance work?
  • How might you test your classes?

Resources