require 'test/unit' class TestContainsMethodOnMarjoree < Test::Unit::TestCase include Marjoree def setup $db.do( "CREATE TABLE TEST_TABLE( id int NOT NULL, value int NOT NULL )" ) $db.do( "INSERT INTO TEST_TABLE ( id, value ) VALUES( 0, 10 )" ) $db.do( "INSERT INTO TEST_TABLE ( id, value ) VALUES( 1, 11 )" ) end def test_contains assert( contains?( "TEST_TABLE", :id => 0, :value => 10 ) ) assert( contains?( "TEST_TABLE", :id => 1, :value => 11 ) ) assert( contains?( "TEST_TABLE", :id => 1 ) ) assert( !contains?( "TEST_TABLE", :id => 2, :value => 12 ) ) end def test_contains?_with_bad_column_names assert( !contains?( "TEST_TABLE", :wibble => 'wobble' ) ) end def teardown $db.do( "TRUNCATE TABLE TEST_TABLE" ) $db.do( "DROP TABLE TEST_TABLE" ) end end