1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

got tests and specs running after pull request merge

This commit is contained in:
Thorsten Böttger 2011-09-08 19:20:48 +02:00
parent 6bc99dcc39
commit 192fc96ffa
2 changed files with 9 additions and 8 deletions

View file

@ -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'))

View file

@ -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