[rspec-users] rspect weird problem

2011-12-05 Thread Andres M.
Hello everyone, this is really urgent so ill be quick, here is some ruby code that i know works: require 'csv' class Motorcycle attr_reader :name, :weight @@count = 0 def self.find (name) found = nil ObjectSpace.each_object(Motorcycle) { |o| fo

Re: [rspec-users] rspect weird problem

2011-12-06 Thread Andres M.
Patrick Collins wrote in post #1035294: >> Motrocicle.create > > I don't know if this helps, but I am pretty sure "Motrocicle.create" > isn't what > you intended to call. > > Also, I'd like to point out that: > >> def self.find (name) >> found = nil >> ObjectSpace.each_obj

Re: [rspec-users] rspect weird problem

2011-12-06 Thread Andres M.
no, that didn't work, but i found that i may be due to garbage collector taking place before test starts, so the solution was to add a set called instances and then in the initialize method put the following code line "instances << self", this way my instances had a root, preventing the garbage