require 'test/unit' require 'marjoree' require 'marjoree/fixtures' require 'expected_result_set' Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '../fixtures') class TestMultipleDBFixtures < Test::Unit::TestCase include Marjoree # `odbcconf /A {configdsn "SYBASE ASE ODBC Driver" "DSN=first_db|NA=LGLAIB9Y2Y33J,5000|Uid=sa|Pwd=|Database=CRDMGR"}` # `odbcconf /A {configdsn "SYBASE ASE ODBC Driver" "DSN=second_db|NA=LGLAIB9Y2Y33J,5000|Uid=sa|Pwd=|Database=CRDMGR_TEST"}` def self.stub_fixtures(*tables) connect_me_to 'first_db' execute( "CREATE TABLE FIRST( id INT, name VARCHAR(255) )" ) if( !get_user_tables.include?( 'FIRST' ) ) connect_me_to 'second_db' execute( "CREATE TABLE SECOND( id INT )" ) if( !get_user_tables.include?( 'SECOND' ) ) connect_me_to 'first_db' fixtures(*tables) end stub_fixtures :FIRST, :SECOND def test_fixtures_inserted_into_correct_db connect_me_to 'first_db' assert_equal( 2, count( "FIRST" ) ) connect_me_to 'second_db' assert_equal( 3, count( "SECOND" ) ) end end