<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -164,14 +164,14 @@ begin
   
   desc &quot;Run integration tests&quot;
   Spec::Rake::SpecTask.new(&quot;integration&quot;) do |t|
-    t.spec_files = FileList[&quot;spec/integration/*_test.rb&quot;]
+    t.spec_files = Dir[&quot;spec/integration/*_test.rb&quot;]
     t.spec_opts  = spec_opts.call
   end
   
   %w'postgres sqlite mysql informix oracle ado'.each do |adapter|
     desc &quot;Run #{adapter} specs without coverage&quot;
     Spec::Rake::SpecTask.new(&quot;spec_#{adapter}&quot;) do |t|
-      t.spec_files = [&quot;spec/adapters/#{adapter}_spec.rb&quot;]
+      t.spec_files = [&quot;spec/adapters/#{adapter}_spec.rb&quot;] + Dir[&quot;spec/integration/*_test.rb&quot;]
       t.spec_opts  = spec_opts.call
     end
   end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper.rb')
 unless defined?(ADO_DB)
   ADO_DB = Sequel.ado(:host =&gt; 'MY_SQL_SERVER', :database =&gt; 'MyDB', :user =&gt; 'my_usr', :password =&gt; 'my_pwd')
 end
+INTEGRATION_DB = ADO_DB unless defined?(INTEGRATION_DB)
 
 context &quot;An ADO dataset&quot; do
   before(:each) do</diff>
      <filename>spec/adapters/ado_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ unless defined?(FIREBIRD_DB)
   FIREBIRD_URL = 'firebird://sysdba:masterkey@localhost/reality_spec' unless defined? FIREBIRD_URL
   FIREBIRD_DB = Sequel.connect(ENV['SEQUEL_FB_SPEC_DB']||FIREBIRD_URL)
 end
+INTEGRATION_DB = FIREBIRD_DB unless defined?(INTEGRATION_DB)
 
 def FIREBIRD_DB.sqls
   (@sqls ||= [])</diff>
      <filename>spec/adapters/firebird_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper.rb')
 unless defined?(INFORMIX_DB)
   INFORMIX_DB = Sequel.connect('informix://localhost/mydb')
 end
+INTEGRATION_DB = INFORMIX_DB unless defined?(INTEGRATION_DB)
 
 if INFORMIX_DB.table_exists?(:test)
   INFORMIX_DB.drop_table :test</diff>
      <filename>spec/adapters/informix_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,7 @@ end
 unless defined?(MYSQL_SOCKET_FILE)
   MYSQL_SOCKET_FILE = '/tmp/mysql.sock'
 end
+INTEGRATION_DB = MYSQL_DB unless defined?(INTEGRATION_DB)
 
 MYSQL_URI = URI.parse(MYSQL_DB.uri)
 </diff>
      <filename>spec/adapters/mysql_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper.rb')
 unless defined?(ORACLE_DB)
   ORACLE_DB = Sequel.connect('oracle://hr:hr@localhost/XE')
 end
+INTEGRATION_DB = ORACLE_DB unless defined?(INTEGRATION_DB)
 
 if ORACLE_DB.table_exists?(:items)
   ORACLE_DB.drop_table :items</diff>
      <filename>spec/adapters/oracle_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ unless defined?(POSTGRES_DB)
   POSTGRES_URL = 'postgres://postgres:postgres@localhost:5432/reality_spec' unless defined? POSTGRES_URL
   POSTGRES_DB = Sequel.connect(ENV['SEQUEL_PG_SPEC_DB']||POSTGRES_URL)
 end
+INTEGRATION_DB = POSTGRES_DB unless defined?(INTEGRATION_DB)
 
 def POSTGRES_DB.sqls
   (@sqls ||= [])</diff>
      <filename>spec/adapters/postgres_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,10 @@
 require 'rubygems'
 unless Object.const_defined?('Sequel')
   $:.unshift(File.join(File.dirname(__FILE__), &quot;../../lib/&quot;))
-  require 'sequel/core'
+  require 'sequel'
   Sequel.quote_identifiers = false
 end
 begin
-  require File.join(File.dirname(__FILE__), '../spec_config.rb')
+  require File.join(File.dirname(File.dirname(__FILE__)), 'spec_config.rb')
 rescue LoadError
 end</diff>
      <filename>spec/adapters/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ unless defined?(SQLITE_DB)
   SQLITE_URL = 'sqlite:/' unless defined? SQLITE_URL
   SQLITE_DB = Sequel.connect(ENV['SEQUEL_SQLITE_SPEC_DB']||SQLITE_URL)
 end
+INTEGRATION_DB = SQLITE_DB unless defined?(INTEGRATION_DB)
 
 context &quot;An SQLite database&quot; do
   before do</diff>
      <filename>spec/adapters/sqlite_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
 require 'rubygems'
+require 'logger'
 unless Object.const_defined?('Sequel')
   $:.unshift(File.join(File.dirname(__FILE__), &quot;../../lib/&quot;))
   require 'sequel'
 end
 begin
-  require File.join(File.dirname(__FILE__), '../spec_config.rb')
+  require File.join(File.dirname(File.dirname(__FILE__)), 'spec_config.rb') unless defined?(INTEGRATION_DB)
 rescue LoadError
 end
 
@@ -16,12 +17,13 @@ def clear_sqls
 end 
 
 class Spec::Example::ExampleGroup
-  def start_logging
-    require 'logger'
-    INTEGRATION_DB.loggers &lt;&lt; Logger.new(STDOUT)
-  end
-  def stop_logging
+  def log
+    begin
+      INTEGRATION_DB.loggers &lt;&lt; Logger.new(STDOUT)
+      yield
+    ensure
      INTEGRATION_DB.loggers.clear
+    end
   end
 end
 </diff>
      <filename>spec/integration/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6776f65f82999322ad3d46ac022380ecfe170c18</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </author>
  <url>http://github.com/jeremyevans/sequel/commit/9117746178fd084dd4965e817c1b7bf8b6341a49</url>
  <id>9117746178fd084dd4965e817c1b7bf8b6341a49</id>
  <committed-date>2009-06-04T10:29:24-07:00</committed-date>
  <authored-date>2009-06-04T10:29:24-07:00</authored-date>
  <message>Have the adapter specs also run the integration tests

The integration tests can also be thought of as generic adapter
specs.  In my testing, I was always running both the adapter specs
and the integration tests.  Combining them should make my test suite
run faster (especially the JRuby tests because of the startup time).

Implementation is fairly simple, just assigning the adapter database
constant to the integration database constant and including the
integration spec files.

The integration rake task stays, for backwards compatibility and
because some adapters don't have adapter specs (e.g. H2 on JDBC).

Combining the two is what helped me find the PostgreSQL
Database#indexes problem.

Finally, change the start_logging/stop_logging helper methods to
a single log method that takes a block.  Almost always I use the
logging methods when debugging where an exception is raised,
and the log method makes that a lot easier.</message>
  <tree>18e278870324265839df5765fa67a9ca6577adb4</tree>
  <committer>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </committer>
</commit>
