I'm using Riot (https://github.com/thumblemonks/riot) for testing though we could use something else.
I get test output like this:
> ruby my_test_file.rb
Running a test
+ something works
+ something else works
- something failed
I'd like to programmatically access this information. Something like:
test = TestClass.load("my_test_file.rb")
result = test.run
result.errors # some array