TDD two clases, three ways. Compare RSpec, MiniTest, and Test::Unit
Note I added a rakefile that you can run all tests (rspec and MiniTest/TestUnit) by "bundle exec rake"
- In the MiniTest folder, write a test asserting that the Admiral does have a battleship
- In the MiniTest folder, change the ammunition from 100 to 10, and assert that's the starting point for a battleship
- Use the MiniTest Should syntax to confirm that the Battleship can request more ammunition
- TDD in whichever syntax you like that the Battleship can recevie more ammunition
- When the battleship fires, it should return a hit or a miss
- Create a separate class "Fate" that will determine if the hit is a miss or a hit
- Fate should impement a rand() to decide if it was a hit or not
- You should stub/mock out the Fate call to test what happens if it hits or misses
- MiniTest: https://github.com/seattlerb/minitest
- Testing with MiniTest: http://rubylearning.com/blog/2011/07/28/how-do-i-test-my-code-with-minitest/
- MiniTest matchers: https://github.com/zenspider/minitest-matchers
Copyright: 2012 Jesse Wolgamott, MIT License (See LICENSE)