<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/rspec_rails_integration.feature</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'rubygems'
 require 'spork'
 
 Spork.prefork do
-  # Loading more in this block will cause your specs to run faster. However, 
+  # Loading more in this block will cause your tests to run faster. However, 
   # if you change any configuration or code from libraries loaded here, you'll
   # need to restart spork for it take effect.
   </diff>
      <filename>assets/bootstrap.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,10 @@ Feature: Cucumber integration with rails
       require 'spork'
 
       Spork.prefork do
+        # Loading more in this block will cause your tests to run faster. However, 
+        # if you change any configuration or code from libraries loaded here, you'll
+        # need to restart spork for it take effect.
+        
         # Sets up the Rails environment for Cucumber
         ENV['RAILS_ENV'] = &quot;cucumber&quot;
         require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
@@ -23,18 +27,14 @@ Feature: Cucumber integration with rails
         end
 
         require 'webrat/core/matchers'
-        require 'cucumber' # I needed to add this... We could move this require to Spork if we think it is better there...
+        require 'cucumber'
         require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
-        require 'spec/rails' # I needed to add this as well to avoid the #records error...
+        require 'spec/rails'
         require 'cucumber/rails/rspec'
-        class ActiveRecord::Base
-          class &lt;&lt; self
-            def establish_connection
-              ($loaded_stuff ||= []) &lt;&lt; 'establish_connection'
-            end
-          end
-        end
-        ($loaded_stuff ||= []) &lt;&lt; 'prefork block'
+        
+        # ---- this is for this test only ----
+        $loaded_stuff &lt;&lt; 'prefork block'
+        # ---- end test stuff ----
       end
 
       Spork.each_run do
@@ -43,7 +43,10 @@ Feature: Cucumber integration with rails
         Cucumber::Rails.use_transactional_fixtures
         Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
                                       # (e.g. rescue_action_in_public / rescue_responses / rescue_from)
-        ($loaded_stuff ||= []) &lt;&lt; 'each_run block'
+        
+        # ---- this is for this test only ----
+        $loaded_stuff &lt;&lt; 'each_run block'
+        # ---- end test stuff ----
       end
       &quot;&quot;&quot;
     And a file named &quot;features/cucumber_rails.feature&quot; with:
@@ -54,14 +57,25 @@ Feature: Cucumber integration with rails
       &quot;&quot;&quot;
     And a file named &quot;features/support/cucumber_rails_helper.rb&quot; with:
       &quot;&quot;&quot;
-      ($loaded_stuff ||= []) &lt;&lt; 'features/support/cucumber_rails_helper.rb'
+      $loaded_stuff &lt;&lt; 'features/support/cucumber_rails_helper.rb'
+      &quot;&quot;&quot;
+    And a file named &quot;config/environments/cucumber.rb&quot; with:
+      &quot;&quot;&quot;
+      # your cucumber env here
+      &quot;&quot;&quot;
+    And a file named &quot;config/database.yml&quot; with:
+      &quot;&quot;&quot;
+      cucumber:
+        adapter: sqlite3
+        database: db/cucumber.sqlite3
+        timeout: 5000
       &quot;&quot;&quot;
     And a file named &quot;features/step_definitions/cucumber_rails_steps.rb&quot; with:
       &quot;&quot;&quot;
       Then &quot;it should work&quot; do
         Spork.state.should == :using_spork
         RAILS_ENV.should == 'cucumber'
-        $loaded_stuff.should include('establish_connection')
+        $loaded_stuff.should include('ActiveRecord::Base.establish_connection')
         $loaded_stuff.should include('User')
         $loaded_stuff.should include('UserObserver')
         $loaded_stuff.should include('ApplicationHelper')
@@ -72,17 +86,6 @@ Feature: Cucumber integration with rails
         puts &quot;It worked!&quot;
       end
       &quot;&quot;&quot;
-    And a file named &quot;config/environments/cucumber.rb&quot; with:
-      &quot;&quot;&quot;
-      $cucumber_used = true
-      &quot;&quot;&quot;
-    And a file named &quot;config/database.yml&quot; with:
-      &quot;&quot;&quot;
-      cucumber:
-        adapter: sqlite3
-        database: db/cucumber.sqlite3
-        timeout: 5000
-      &quot;&quot;&quot;
     Scenario: Analyzing files were preloaded
       When I run spork --diagnose
       Then the output should not contain &quot;user_observer.rb&quot;</diff>
      <filename>features/cucumber_rails_integration.feature</filename>
    </modified>
    <modified>
      <diff>@@ -35,4 +35,22 @@ Given &quot;the application has a model, observer, route, and application helper&quot; do
     &quot;&quot;&quot;
       ($loaded_stuff ||= []) &lt;&lt; 'config/routes.rb'
     &quot;&quot;&quot;
+  
+  Given 'a file named &quot;config/initializers/initialize_loaded_stuff.rb&quot; with:',
+    &quot;&quot;&quot;
+    $loaded_stuff ||= []
+    &quot;&quot;&quot;
+  
+  Given 'a file named &quot;config/initializers/log_establish_connection_calls.rb&quot; with:',
+    &quot;&quot;&quot;
+    class ActiveRecord::Base
+      class &lt;&lt; self
+        def establish_connection_with_load_logging(*args)
+          establish_connection_without_load_logging(*args)
+          $loaded_stuff &lt;&lt; 'ActiveRecord::Base.establish_connection'
+        end
+        alias_method_chain :establish_connection, :load_logging
+      end
+    end
+    &quot;&quot;&quot;
 end
\ No newline at end of file</diff>
      <filename>features/steps/rails_steps.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>features/rails_integration.feature</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>7e72d5f6da43d0330a2000dc36a1356628e5b08a</id>
    </parent>
  </parents>
  <author>
    <name>Tim Harper</name>
    <email>timcharper@gmail.com</email>
  </author>
  <url>http://github.com/timcharper/spork/commit/1360dca7af0fa3dd0b3bd976db36f0359be3c629</url>
  <id>1360dca7af0fa3dd0b3bd976db36f0359be3c629</id>
  <committed-date>2009-06-08T11:38:44-07:00</committed-date>
  <authored-date>2009-06-08T11:38:10-07:00</authored-date>
  <message>cleaned up features to make them more suitable as examples</message>
  <tree>a05d0d6bf731277d60a5716cf3e8e870006db47c</tree>
  <committer>
    <name>Tim Harper</name>
    <email>timcharper@gmail.com</email>
  </committer>
</commit>
