[Nitro] Nitro/Og rspec heads-up: any alternative solutions.
Mark Van De Vyver
mvyver at gmail.com
Thu Oct 4 05:49:14 EDT 2007
Hi Devs,
Hope this 'head-up' saves someone some time. I'd appreciate any
alternative the are better then what I cam up with.
The following is known on the rspec list and I've asked there for
suggestions - will fwd if anything useful comes up.
The essential point is that rspec describe blocks are not isolated name spaces.
Consequence: if you're going to define classes then you'll need to
choose different class names for each describe/example block, or else
the spec's will run a good chance of being contaminated.
Any other suggestions?
Example, from the code snippets below, the last describe/example block
will return two attributes for the Person class:
@attrs # [:name, :age]
:)
module Og
describe DbiAdapter, "field_sql_for_attribute (without :sql annotation)" do
include OgSpecExpectations
before(:all) do
class Person
attr_accessor :name, String, :sql => "some text"
end
end
<...>
end
describe DbiAdapter, "field_sql_for_attribute (without :sql annotation)" do
include OgSpecExpectations
before(:all) do
class Person
attr_accessor :age, String
end
<...>
@attrs = @man.store.serializable_attributes_for_class(Person)
end
<...>
end
end
More information about the Nitro-general
mailing list