<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>script/test_console</filename>
    </added>
    <added>
      <filename>script/test_prepare_database</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -58,8 +58,9 @@ Development
 Please check out /doc directory for high level overview about adva-cms.
  
 Running tests:
-  rake db:test:clone     # Clones from your development database to test database
-  ruby script/test-adva  # Runs all adva-cms tests
+  rake db:test:clone       # Clones from your development database to test database
+  ruby script/test-adva -p # Prepares the database and runs all adva-cms tests
+  ruby script/test-adva    # Runs all adva-cms tests without preparing the database
   ruby script/test-adva vendor/adva/engines/adva_wiki # Runs only adva_wiki tests
 
 Please report bugs to Lighthouse: </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@ class Test::Unit::TestCase
     I18n.default_locale = :en
   end
   alias_method_chain :setup, :test_setup
-  
+
   def teardown_with_test_setup
     teardown_without_test_setup
   ensure
@@ -42,13 +42,21 @@ class Test::Unit::TestCase
   alias_method_chain :teardown, :test_setup
 end
 
+# FIXME at_exit { try to rollback any open transactions }
+
 # include this line to test adva-cms with url_history installed
 # require dir + '/plugins/url_history/init_url_history'
 
 require_all dir + &quot;/contexts.rb&quot;,
-            dir + &quot;/fixtures.rb&quot;,
+            # dir + &quot;/fixtures.rb&quot;,
             dir + &quot;/test_helper/**/*.rb&quot;
 require_all dir + &quot;/../../**/test/contexts.rb&quot;,
-            dir + &quot;/../../**/test/fixtures.rb&quot;,
+            # dir + &quot;/../../**/test/fixtures.rb&quot;,
             dir + &quot;/../../**/test/test_helper/**/*.rb&quot;
 
+if DO_PREPARE_DATABASE
+  puts 'Preparing the database ...'
+  require_all dir + &quot;/fixtures.rb&quot;
+  require_all dir + &quot;/../../**/test/fixtures.rb&quot;
+end
+</diff>
      <filename>engines/adva_cms/test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,14 @@ OptionParser.new do |o|
     With.options[:line] = line
   end
   
+  o.on('-p', '--prepare-database', &quot;Do not initialize fixtures to the database.&quot;) do |line|
+    DO_PREPARE_DATABASE = true
+  end
+  
   o.on('-w', '--with=ASPECTS', &quot;Run tests defined for the given ASPECTS (comma separated).&quot;) do |aspects|
     With.aspects += aspects.split(/,/)
   end
-end.parse!(ARGV)
\ No newline at end of file
+end.parse!(ARGV)
+
+DO_PREPARE_DATABASE = false unless defined?(DO_PREPARE_DATABASE)
+</diff>
      <filename>engines/adva_cms/test/test_helper/parse_options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 #!/usr/bin/env ruby
 
 def files_to_load(paths)
-  paths.reject!{|path| path =~ /^--/ } # ignore options
+  paths.reject!{|path| path =~ /^-/ } # ignore options
   paths = [engines_path] if paths.empty?
   result = []
   paths.each do |path|
@@ -31,8 +31,8 @@ paths = ARGV.clone
 paths = files_to_load(paths)
 
 unless paths.empty?
-  puts 'Running adva-cms tests...'
+  puts 'Running adva-cms tests ...'
   # root_path = File.expand_path(File.dirname(__FILE__)).gsub!(/vendor.*/, '')
   # paths.each{|path| puts path.gsub(root_path, '') }
-  paths.each{|path| require path }
+  paths.sort.each{|path| require path }
 end</diff>
      <filename>script/test</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9fbff1a18503b52d21f3365183a92526ca868b04</id>
    </parent>
  </parents>
  <author>
    <name>Sven Fuchs</name>
    <email>svenfuchs@artweb-design.de</email>
  </author>
  <url>http://github.com/svenfuchs/adva_cms/commit/200404880a307f76a5a67110abdc430807a38b02</url>
  <id>200404880a307f76a5a67110abdc430807a38b02</id>
  <committed-date>2009-02-13T05:56:45-08:00</committed-date>
  <authored-date>2009-02-12T01:09:09-08:00</authored-date>
  <message>remove the database preparation from the default test run. you can now opt in to preparing the database before test run by passing the option -p or --prepare-database. you can also prepare the database with the script scripts/test_prepare_database</message>
  <tree>5340a49f246e6cfdb591c3ddc4811d8cfab59531</tree>
  <committer>
    <name>Joshua Harvey</name>
    <email>joshmh@gmail.com</email>
  </committer>
</commit>
