From: Iain Barnett Date: 2010-09-28T09:31:15+09:00 Subject: Re: error message, undefined method in Set On 27 Sep 2010, at 14:55, Brian Candler wrote: > It is possible that there is another Set class defined somewhere. Try: > > puts Set.to_s # does this show "Set" or "Foo::Set" ? It shows Set > > assert_equal Set, ::Set, "Using Set not at the top level!" This passed. On 27 Sep 2010, at 15:02, Robert Klemme wrote: > ... I would rather try this to get an idea of > what class @@available_classes is an instance of: > > p @@available_classes.class, @@available_classes.class.ancestors Set [Set, Enumerable, Object, Kernel, BasicObject] I played around with a few things, and it turns out that this works (whether at the top of the test file or another file that does all the requiring) : require 'set' require 'choice' #this is the class that utilises Set but this throws errors: require 'choice' require 'set' I'm very surprised that the order of requires (at the top of a file) can affect anything in this way. Is this the way it's supposed be? If not, what could be the cause? The Choice class itself doesn't have any requires in it, btw, that's all done in a separate file for all the app. Regards, Iain