This is our challenge to write a mini test framework, in preparation for the second project, to understand what happens behind the scenes of a test framework
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
monster.rb
monster_test.rb
test_superclass.rb

README.md

nano_padawans_test

Our second project by RGSoC is to develop a tool for documentation testing. Therefore, we want to learn first about testing and the already existing tools. A challenge for us here is to write a mini test framework, to understand what happens behind the scenes of an actual TF.

Elza - a monster that eats meat

We created a class Monster and a method eat. Therefore a MonsterTest class has a method eat_test. There is also a superclass Test, that MonsterTest inherits from.

class Test methods

run calls all methods ending on _test

assert takes 3 arguments (expected, actual, msg = ""), it raises an exception, if expected is not actual and returns a victory message otherwise

self.inherited(subclass) collects all inherited classes

def self.run_all_tests runs all of test of all inherited classes

At the end, you need to call Test.run_all_tests and BOOM!! all the test for all the classes run at a very high speed.

Elza ate meat.