Hi --

On Fri, 30 Jan 2009, Simon Chiang wrote:

>
>> It's not specific to minitest; it's a change in how constants are
>> resolved. I'm not sure of the exact formulation but what's happening
>> is that in a class_eval'd code block (which I think is what describe
>> does), 1.8 is looking for a constant scoped to the outer level, while
>> 1.9 is looking for one that is scope to the class that's being
>> class_evaled.
>
> Interesting.  I expected it would be something like this.  Kinda makes
> specs hard to use under 1.8 IMO.  You're left with nesting describes
> within a module, or using the full constant name.
>
>  module A
>    module B
>    end
>
>    describe "Nest in Module" do
>      it "should show nesting works" do
>        B.must_equal A::B
>      end
>    end
>  end
>
>  describe "Full Constant Name" do
>    it "should show full names works" do
>      A::B.must_equal A::B
>    end
>  end

All it means is that you can't make an assertion in the spec that
conflicts with how the language is engineered, and that's always true
:-)


David

-- 
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

http://www.wishsight.com => Independent, social wishlist management!