[Nitro] Testing

Mark Van De Vyver mvyver at gmail.com
Wed Nov 7 13:03:47 EST 2007

My 2c.

I've found the following helps make it more obvious what a spec refers
to, and when the spec fails you get a better idea about the class

module Og
  describe HasManyCollection, "#resolve_polymorphic with some context
description" do
    it "should ..." do

For a fialing test (outside of rake test:og) you'll see something like

Og::HasManyCollection##resolve_polymorphic with some context
description should ...." failed etc.

Oh and if you think of a spec for behavior that isn't implemented,
include it using RSpec's
pending("comment") do ...end;
and then comment it out - that way your insights are recorded for
posterity.  RSpec pending's cuase the rake task to register the
example as a fail hence the suggestion to comment it out.

On a related note, I thought a convention to _try_ to adhere to was to
include in ./test/file.rb specs for methods that are found in
Now this isn't always possible in a pure way, but worth shooting for?

Like I said, just my 2c.

On Nov 8, 2007 12:25 AM, Robert Mela <rob at robmela.com> wrote:
> I'd like to put some add/remove test cases into
> og/test/og/model/taggable.rb, perhaps also have  and a "does it even
> start?" test into nitro/test/nitro/application.rb.
> Same could go into a new file in og/test/relation/many_to_many.rb
> Are the tests that are there now the model to follow?
> Thanks.
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

More information about the Nitro-general mailing list