Forum: Nitro Testing

Posted by Robert Mela (Guest)
on 2007-11-07 14:26
Attachment: rob.vcf (117 Bytes)
(Received via mailing list)
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.
Posted by Mark Van De Vyver (mvyver)
on 2007-11-07 19:04
(Received via mailing list)
Hi,
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
invovled:

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

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
./lib/file.rb.
Now this isn't always possible in a pure way, but worth shooting for?

Like I said, just my 2c.
Mark
Posted by Mark Van De Vyver (mvyver)
on 2007-11-12 11:39
(Received via mailing list)
On Nov 8, 2007 12:25 AM, Robert Mela <rob@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?

FYI Devs,
Rubinius has a nice description of a style guide, as well as a
description of a work flow worth comtemplating?
They seem to have some neat tools - not sure if they are available 
separately.

Mark
Posted by George Moschovitis (Guest)
on 2007-11-12 21:29
(Received via mailing list)
thanks, will check this out.

-g.
This topic is locked and can not be replied to.