I'm playing around with some ideas for literate programming and
I've written my tests to be XP style stories. I have one Context
per story. In the Context, I want to declare a string containing
the English description of the story, a float containing the
effort of the story and a bool describing if the story has been
completed or not.
Then, similar to the test runner, I want to go through the
classes and create a report which lists the stories
that are in the current test executable (the iteration),
shows which stories are completed, whether all
the tests pass and also a "velocity" for the iteration so far
(essentially, the number of effort points divided by
the time that has elapsed since the start of the of the iteration).
Anyway, I can think of a number of ways to do this, but they
all require modifications to igloo. Although my use for this
functionality is admittedly a bit strange (doing all my planning
and project tracking in the test code ;-) ), I think the
functionality would be generally useful so I'm wondering
what your thoughts are, or if you were already planning
to do something that would enable this.
MikeC
I have a couple of ideas. I think trying to pass arbitrary attributes
to the TestListener would be difficult, but you might be able to
at least pass the Context objects to the TestListener
before/after the tests are run. Then if you could store
lists of arbitrary data on the results objects you could
create a report for it. But none of this is necessarily
easy with the current implementation.
For my purposes it might just be easier to write a different
test runner that dealt with subclassed Context objects.
The information I'm collecting isn't really related to the
running of the tests, only the result.
Hopefully I'll have some time this weekend to try some
things (though I'm struggling with a hardware issue at the
moment).
Anyway, thanks again for igloo. I'm enjoying working with it.
I'm retired from the software world and have been puttering
away with Ruby for the last 5 years. For my C++ project
I was looking for something that would give me the same
comfort level as rspec. Igloo is well on it's way. All I
need now are mocks ;-)
On a kind of unrelated note, I really enjoyed watching your
Game of Life kata and I've recommended it to several
people who are new to TDD/BDD.
MikeC