spec/unit/memory_leak_spec.rb in aasm-4.0.3 vs spec/unit/memory_leak_spec.rb in aasm-4.0.4

- old
+ new

@@ -10,29 +10,29 @@ # AASM::StateMachine.instance_variable_get("@machines") # end # it "should be created without memory leak" do # machines_count = machines.size -# state_count = number_of_objects(AASM::State) -# event_count = number_of_objects(AASM::Event) +# state_count = number_of_objects(AASM::Core::State) +# event_count = number_of_objects(AASM::Core::Event) # puts "event_count = #{event_count}" -# transition_count = number_of_objects(AASM::Transition) +# transition_count = number_of_objects(AASM::Core::Transition) # load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb') # machines.size.should == machines_count + 1 # + Process # number_of_objects(Models::Process).should == 0 -# number_of_objects(AASM::State).should == state_count + 3 # + Process -# puts "event_count = #{number_of_objects(AASM::Event)}" -# number_of_objects(AASM::Event).should == event_count + 2 # + Process -# number_of_objects(AASM::Transition).should == transition_count + 2 # + Process +# number_of_objects(AASM::Core::State).should == state_count + 3 # + Process +# puts "event_count = #{number_of_objects(AASM::Core::Event)}" +# number_of_objects(AASM::Core::Event).should == event_count + 2 # + Process +# number_of_objects(AASM::Core::Transition).should == transition_count + 2 # + Process # Models.send(:remove_const, "Process") if Models.const_defined?("Process") # load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb') # machines.size.should == machines_count + 1 # + Process -# number_of_objects(AASM::State).should == state_count + 3 # + Process -# # ObjectSpace.each_object(AASM::Event) {|o| puts o.inspect} -# puts "event_count = #{number_of_objects(AASM::Event)}" -# number_of_objects(AASM::Event).should == event_count + 2 # + Process -# number_of_objects(AASM::Transition).should == transition_count + 2 # + Process +# number_of_objects(AASM::Core::State).should == state_count + 3 # + Process +# # ObjectSpace.each_object(AASM::Core::Event) {|o| puts o.inspect} +# puts "event_count = #{number_of_objects(AASM::Core::Event)}" +# number_of_objects(AASM::Core::Event).should == event_count + 2 # + Process +# number_of_objects(AASM::Core::Transition).should == transition_count + 2 # + Process # end # end