Testing

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.

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

On Nov 8, 2007 12:25 AM, Robert M. [email protected] 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

thanks, will check this out.

-g.