From 253bb6b9260938ed673e2c0059d729cffff4a523 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 4 Jun 2011 23:19:17 +0100 Subject: Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. --- activerecord/test/cases/associations/belongs_to_associations_test.rb | 2 +- activerecord/test/cases/associations/callbacks_test.rb | 2 +- activerecord/test/cases/associations/cascaded_eager_loading_test.rb | 2 +- .../cases/associations/eager_load_includes_full_sti_class_test.rb | 2 +- .../test/cases/associations/eager_load_nested_include_test.rb | 2 +- activerecord/test/cases/associations/eager_singularization_test.rb | 2 +- activerecord/test/cases/associations/eager_test.rb | 2 +- activerecord/test/cases/associations/extension_test.rb | 2 +- activerecord/test/cases/associations/habtm_join_table_test.rb | 2 +- .../cases/associations/has_and_belongs_to_many_associations_test.rb | 4 ++-- activerecord/test/cases/associations/has_many_associations_test.rb | 2 +- .../test/cases/associations/has_many_through_associations_test.rb | 2 +- activerecord/test/cases/associations/has_one_associations_test.rb | 2 +- .../test/cases/associations/has_one_through_associations_test.rb | 2 +- activerecord/test/cases/associations/identity_map_test.rb | 2 +- activerecord/test/cases/associations/inner_join_association_test.rb | 2 +- activerecord/test/cases/associations/inverse_associations_test.rb | 2 +- activerecord/test/cases/associations/join_model_test.rb | 2 +- .../test/cases/associations/nested_through_associations_test.rb | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) (limited to 'activerecord/test/cases/associations') diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index 5a900e0605..d7293aa1e3 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/developer' require 'models/project' require 'models/company' diff --git a/activerecord/test/cases/associations/callbacks_test.rb b/activerecord/test/cases/associations/callbacks_test.rb index 2d0d4541b4..387a25b7b1 100644 --- a/activerecord/test/cases/associations/callbacks_test.rb +++ b/activerecord/test/cases/associations/callbacks_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/author' require 'models/project' diff --git a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb index ff376a68d8..d21afff978 100644 --- a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +++ b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/comment' require 'models/author' diff --git a/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb b/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb index d75791cab9..41cf745f91 100644 --- a/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +++ b/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb @@ -1,4 +1,4 @@ -require 'cases/helper' +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/tagging' diff --git a/activerecord/test/cases/associations/eager_load_nested_include_test.rb b/activerecord/test/cases/associations/eager_load_nested_include_test.rb index 2cf9f89c3c..de1f47873f 100644 --- a/activerecord/test/cases/associations/eager_load_nested_include_test.rb +++ b/activerecord/test/cases/associations/eager_load_nested_include_test.rb @@ -1,4 +1,4 @@ -require 'cases/helper' +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/tag' require 'models/author' diff --git a/activerecord/test/cases/associations/eager_singularization_test.rb b/activerecord/test/cases/associations/eager_singularization_test.rb index 07d0b24613..ffb5411a5b 100644 --- a/activerecord/test/cases/associations/eager_singularization_test.rb +++ b/activerecord/test/cases/associations/eager_singularization_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) class Virus < ActiveRecord::Base belongs_to :octopus diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 325fc58958..945edad48a 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/tagging' require 'models/tag' diff --git a/activerecord/test/cases/associations/extension_test.rb b/activerecord/test/cases/associations/extension_test.rb index 24830a661a..c0a8f74834 100644 --- a/activerecord/test/cases/associations/extension_test.rb +++ b/activerecord/test/cases/associations/extension_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/comment' require 'models/project' diff --git a/activerecord/test/cases/associations/habtm_join_table_test.rb b/activerecord/test/cases/associations/habtm_join_table_test.rb index fe2b82f2c1..cc0a6cd6c2 100644 --- a/activerecord/test/cases/associations/habtm_join_table_test.rb +++ b/activerecord/test/cases/associations/habtm_join_table_test.rb @@ -1,4 +1,4 @@ -require 'cases/helper' +require File.expand_path('../../helper', __FILE__) class MyReader < ActiveRecord::Base has_and_belongs_to_many :my_books diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index e5735988d0..171177ad1d 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/developer' require 'models/project' require 'models/company' @@ -100,7 +100,7 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal 'c1', record[0] assert_equal 't1', record[1] end - + def test_proper_usage_of_primary_keys_and_join_table setup_data_for_habtm_case diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 49999630b6..b87a1744c1 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/developer' require 'models/project' require 'models/company' diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 877148bd5e..476bc637f6 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/person' require 'models/reference' diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb index 299688d840..9bafe0f57d 100644 --- a/activerecord/test/cases/associations/has_one_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/developer' require 'models/project' require 'models/company' diff --git a/activerecord/test/cases/associations/has_one_through_associations_test.rb b/activerecord/test/cases/associations/has_one_through_associations_test.rb index 2503349c08..24576fb580 100644 --- a/activerecord/test/cases/associations/has_one_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_through_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/club' require 'models/member_type' require 'models/member' diff --git a/activerecord/test/cases/associations/identity_map_test.rb b/activerecord/test/cases/associations/identity_map_test.rb index 9b8635774c..0dd6c76efd 100644 --- a/activerecord/test/cases/associations/identity_map_test.rb +++ b/activerecord/test/cases/associations/identity_map_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/author' require 'models/post' diff --git a/activerecord/test/cases/associations/inner_join_association_test.rb b/activerecord/test/cases/associations/inner_join_association_test.rb index e5e9ca6131..1c0fe8368f 100644 --- a/activerecord/test/cases/associations/inner_join_association_test.rb +++ b/activerecord/test/cases/associations/inner_join_association_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/post' require 'models/comment' require 'models/author' diff --git a/activerecord/test/cases/associations/inverse_associations_test.rb b/activerecord/test/cases/associations/inverse_associations_test.rb index 76282213d8..9e4975566b 100644 --- a/activerecord/test/cases/associations/inverse_associations_test.rb +++ b/activerecord/test/cases/associations/inverse_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/man' require 'models/face' require 'models/interest' diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index b59ce4efeb..c869e6fbc5 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'active_support/core_ext/object/inclusion' require 'models/tag' require 'models/tagging' diff --git a/activerecord/test/cases/associations/nested_through_associations_test.rb b/activerecord/test/cases/associations/nested_through_associations_test.rb index dd450a2a8e..b13b8d5e36 100644 --- a/activerecord/test/cases/associations/nested_through_associations_test.rb +++ b/activerecord/test/cases/associations/nested_through_associations_test.rb @@ -1,4 +1,4 @@ -require "cases/helper" +require File.expand_path('../../helper', __FILE__) require 'models/author' require 'models/post' require 'models/person' -- cgit v1.2.3