Just add your unit test file to the tests
directory.
Please replace 'LastName' with 'NetId' in your filename.
If using rspec, add require 'rspec/autorun'
to your test file (see tests/example_spec.rb
). Make sure your filename ends in 'spec' or it will not be run correctly.
If using minitest, use require 'minitest/autorun'
(see tests/example_minitest.rb
). Make sure your class has a unique name or it will not run (such as <NetId>Test
). If extending Minitest
, make sure you use MiniTest::Test
instead of MiniTest::Unit::TestCase
If using another (or no) testing framework, please make sure your file is runnable with ruby filename
and then you can place it in the tests
directory as normal.
If using no framework, it would be nice if you could format the output nicely, or quickly wrap your code in minitest or rspec.
Remove any importing of your Triple class or Enumerable module, we will use the standardized triple class in this directory.
You need to run these commands to install the testing libraries. (You'll need admin privledges, sudo
on Linux)
gem install rspec
gem install rantly
gem install minitest
Specify the full path to your Enumerable module in triple.rb
Then simply:
ruby run_all.rb