diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3a802ca..681478d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,8 +4,9 @@ require 'aasm' require 'rspec' require 'rspec/autorun' -require 'ruby-debug'; Debugger.settings[:autoeval] = true; debugger; rubys_debugger = 'annoying' -require 'ruby-debug/completion' + +# require 'ruby-debug'; Debugger.settings[:autoeval] = true; debugger; rubys_debugger = 'annoying' +# require 'ruby-debug/completion' def load_schema config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) diff --git a/test/unit/state_machine_test.rb b/test/unit/state_machine_test.rb index 6bf4f01..c9d63eb 100644 --- a/test/unit/state_machine_test.rb +++ b/test/unit/state_machine_test.rb @@ -7,22 +7,22 @@ class StateMachineTest < Test::Unit::TestCase should "be created without memory leak" do assert_equal 1, AASM::StateMachine.instance_variable_get("@machines").size # AuthMachine assert_number_of_objects AASM::SupportingClasses::State, 5 # AuthMachine - assert_number_of_objects AASM::SupportingClasses::Event, 10 # AuthMachine - assert_number_of_objects AASM::SupportingClasses::StateTransition, 18 # AuthMachine + assert_number_of_objects AASM::SupportingClasses::Event, 11 # AuthMachine + assert_number_of_objects AASM::SupportingClasses::StateTransition, 19 # AuthMachine load File.expand_path(File.dirname(__FILE__) + '/../models/process.rb') assert_equal 2, AASM::StateMachine.instance_variable_get("@machines").size # AuthMachine + Process assert_number_of_objects Models::Process, 0 assert_number_of_objects AASM::SupportingClasses::State, 8 # AuthMachine + Process - assert_number_of_objects AASM::SupportingClasses::Event, 12 # AuthMachine + Process - assert_number_of_objects AASM::SupportingClasses::StateTransition, 20 # AuthMachine + Process + assert_number_of_objects AASM::SupportingClasses::Event, 13 # AuthMachine + Process + assert_number_of_objects AASM::SupportingClasses::StateTransition, 21 # AuthMachine + Process Models.send(:remove_const, "Process") if Models.const_defined?("Process") load File.expand_path(File.dirname(__FILE__) + '/../models/process.rb') assert_equal 2, AASM::StateMachine.instance_variable_get("@machines").size # AuthMachine + Process assert_number_of_objects AASM::SupportingClasses::State, 8 # AuthMachine + Process - assert_number_of_objects AASM::SupportingClasses::Event, 12 # AuthMachine + Process - assert_number_of_objects AASM::SupportingClasses::StateTransition, 20 # AuthMachine + Process + assert_number_of_objects AASM::SupportingClasses::Event, 13 # AuthMachine + Process + assert_number_of_objects AASM::SupportingClasses::StateTransition, 21 # AuthMachine + Process end end