benzelano / test_lh_import

1 stars 0 forks source link

ActiveRecord 2.3.2 Test Failures #132

Closed benzelano closed 13 years ago

benzelano commented 13 years ago

Patrick Klingemann opened this issue

I am having trouble getting my state machine to set the initial state, it was always coming up nil in my staging environment. It works fine in production and development. So I decided to run the tests on state_machine and I’m receiving failures. Is this a configuration issue on my server? Below are the failures:

1) Failure: test_should_allow_chaining_scopes(ActiveRecordTest::MachineTest) [./test/unit/integrations/active_record_test.rb:142:in test_should_allow_chaining_scopes&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaef45e40 id: 2, state: nil>]> expected but was <[]>.

2) Failure: test_should_only_include_records_with_state_in_singular_with_scope(ActiveRecordTest::MachineTest) [./test/unit/integrations/active_record_test.rb:101:in test_should_only_include_records_with_state_in_singular_with_scope&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaf11bf80 id: 1, state: nil>]> expected but was <[]>.

3) Failure: test_should_only_include_records_with_states_in_plural_with_scope(ActiveRecordTest::MachineTest) [./test/unit/integrations/active_record_test.rb:112:in test_should_only_include_records_with_states_in_plural_with_scope&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaf0c27f0 id: 1, state: nil>,

<#Class:0x2b7eaf0c27f0 id: 2, state: nil>]> expected but was

<[]>.

4) Failure: test_should_only_include_records_without_state_in_singular_without_scope(ActiveRecordTest::MachineTest) [./test/unit/integrations/active_record_test.rb:123:in test_should_only_include_records_without_state_in_singular_without_scope&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaf03b098 id: 1, state: nil>]> expected but was <[]>.

5) Failure: test_should_only_include_records_without_states_in_plural_without_scope(ActiveRecordTest::MachineTest) [./test/unit/integrations/active_record_test.rb:135:in test_should_only_include_records_without_states_in_plural_without_scope&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaefef710 id: 1, state: nil>,

<#Class:0x2b7eaefef710 id: 2, state: nil>]> expected but was

<[]>.

6) Failure: test_should_use_machine_default(ActiveRecordTest::MachineWithColumnDefaultTest) [./test/unit/integrations/active_record_test.rb:369:in test_should_use_machine_default&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was <"idling">.

7) Failure: test_should_return_true_for_predicate_if_matches_current_value(ActiveRecordTest::MachineWithColumnStateAttributeTest) [./test/unit/integrations/active_record_test.rb:415:in test_should_return_true_for_predicate_if_matches_current_value&rsquo; /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:insend’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:

is not true. 8) Failure: test_should_test_for_existence_on_predicate_without_parameters(ActiveRecordTest::MachineWithColumnStateAttributeTest) [./test/unit/integrations/active_record_test.rb:404:in `test_should_test_for_existence_on_predicate_without_parameters’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: is not true. 9) Failure: test_should_not_set_initial_state_after_already_initialized(ActiveRecordTest::MachineWithDynamicInitialStateTest) [./test/unit/integrations/active_record_test.rb:351:in `test_should_not_set_initial_state_after_already_initialized’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 10) Failure: test_should_set_attributes_prior_to_after_initialize_hook(ActiveRecordTest::MachineWithDynamicInitialStateTest) [./test/unit/integrations/active_record_test.rb:333:in `test_should_set_attributes_prior_to_after_initialize_hook’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 11) Failure: test_should_set_initial_state_after_setting_attributes(ActiveRecordTest::MachineWithDynamicInitialStateTest) [./test/unit/integrations/active_record_test.rb:346:in `test_should_set_initial_state_after_setting_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"nil"> expected but was . 12) Failure: test_should_set_initial_state_on_created_object(ActiveRecordTest::MachineWithDynamicInitialStateTest) [./test/unit/integrations/active_record_test.rb:308:in `test_should_set_initial_state_on_created_object’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 13) Failure: test_should_still_set_attributes(ActiveRecordTest::MachineWithDynamicInitialStateTest) [./test/unit/integrations/active_record_test.rb:313:in `test_should_still_set_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <1> expected but was . 14) Failure: test_should_not_change_current_state(ActiveRecordTest::MachineWithFailedActionTest) [./test/unit/integrations/active_record_test.rb:806:in `test_should_not_change_current_state’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 15) Failure: test_should_not_change_current_state(ActiveRecordTest::MachineWithFailedBeforeCallbacksTest) [./test/unit/integrations/active_record_test.rb:763:in `test_should_not_change_current_state’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 16) Failure: test_should_allow_different_initial_state_when_dynamic(ActiveRecordTest::MachineWithInitializedStateTest) [./test/unit/integrations/active_record_test.rb:584:in `test_should_allow_different_initial_state_when_dynamic’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"idling"> expected but was . 17) Failure: test_should_allow_different_initial_state_when_static(ActiveRecordTest::MachineWithInitializedStateTest) [./test/unit/integrations/active_record_test.rb:578:in `test_should_allow_different_initial_state_when_static’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"idling"> expected but was . 18) Failure: test_should_use_default_state_if_protected(ActiveRecordTest::MachineWithInitializedStateTest) [./test/unit/integrations/active_record_test.rb:593:in `test_should_use_default_state_if_protected’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 19) Error: test_should_include_state_in_changed_attributes(ActiveRecordTest::MachineWithLoopbackTest): NoMethodError: undefined method `delete’ for nil:NilClass ./test/unit/integrations/active_record_test.rb:729:in`test_should_include_state_in_changed_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`run’ 20) Failure: test_should_return_true_for_predicate_if_matches_current_value(ActiveRecordTest::MachineWithNonColumnStateAttributeDefinedTest) [./test/unit/integrations/active_record_test.rb:474:in `test_should_return_true_for_predicate_if_matches_current_value’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: is not true. 21) Failure: test_should_set_initial_state_on_created_object(ActiveRecordTest::MachineWithNonColumnStateAttributeDefinedTest) [./test/unit/integrations/active_record_test.rb:482:in `test_should_set_initial_state_on_created_object’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 22) Failure: test_should_only_include_records_with_subclass_states_in_with_scope(ActiveRecordTest::MachineWithOwnerSubclassTest) [./test/unit/integrations/active_record_test.rb:515:in `test_should_only_include_records_with_subclass_states_in_with_scope’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaec67840 id: 1, state: nil>, #<#Class:0x2b7eaec67840 id: 2, state: nil>]> expected but was <[]>. 23) Failure: test_should_only_include_records_without_subclass_states_in_without_scope(ActiveRecordTest::MachineWithOwnerSubclassTest) [./test/unit/integrations/active_record_test.rb:523:in `test_should_only_include_records_without_subclass_states_in_without_scope’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <[#<#Class:0x2b7eaf20cb88 id: 1, state: nil>, #<#Class:0x2b7eaf20cb88 id: 2, state: nil>]> expected but was <[]>. 24) Failure: test_should_be_invalid_if_validation_fails_within_state_scope(ActiveRecordTest::MachineWithStateDrivenValidationsTest) [./test/unit/integrations/active_record_test.rb:869:in `test_should_be_invalid_if_validation_fails_within_state_scope’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: is not true. 25) Failure: test_should_not_set_initial_state_after_already_initialized(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:289:in `test_should_not_set_initial_state_after_already_initialized’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 26) Failure: test_should_set_attributes_prior_to_after_initialize_hook(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:271:in `test_should_set_attributes_prior_to_after_initialize_hook’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 27) Failure: test_should_set_initial_state_before_setting_attributes(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:284:in `test_should_set_initial_state_before_setting_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 28) Failure: test_should_set_initial_state_on_created_object(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:241:in `test_should_set_initial_state_on_created_object’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 29) Failure: test_should_set_initial_state_with_nil_attributes(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:246:in `test_should_set_initial_state_with_nil_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <"parked"> expected but was . 30) Failure: test_should_still_set_attributes(ActiveRecordTest::MachineWithStaticInitialStateTest) [./test/unit/integrations/active_record_test.rb:251:in `test_should_still_set_attributes’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in`**send**’ /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]: <1> expected but was . [original LH ticket](http://pluginaweek.lighthouseapp.com/projects/13288/tickets/32) This ticket has 0 attachment(s).
benzelano commented 13 years ago

Patrick Klingemann commented

I’m pretty sure this was because I was using Ruby 1.8.5. The issue has been resolved by switching to 1.8.7 (REE). You may close if necessary.

benzelano commented 13 years ago

Patrick,

Thanks for the heads up. I apologize for having taken so long to address this ticket. I haven’t tested this on Ruby 1.8.5 so I actually have no idea how it runs on that version. However, what I’ve done is added notes to the README on versions of Ruby are officially supported. See the following commit: http://github.com/pluginaweek/state_machine/commit/791507c856e892129eab93627527185810101ff7