Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> master : Don't duplicate test/test_helper
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Mon, 28 Sep 2009 21:46:40 +0200
  • Message-id: <E1MsMBJ-0007sC-3C@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 382d06bc1f0d9cb60488c344c1468d8fd92d41b2
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Mon Sep 28 21:46:40 2009 +0200

Don't duplicate test/test_helper
---
webservice/lib/tasks/plugin_test/test_helper.rb | 51 +----------------------
1 files changed, 1 insertions(+), 50 deletions(-)

diff --git a/webservice/lib/tasks/plugin_test/test_helper.rb
b/webservice/lib/tasks/plugin_test/test_helper.rb
index e989867..bdd209f 100644
--- a/webservice/lib/tasks/plugin_test/test_helper.rb
+++ b/webservice/lib/tasks/plugin_test/test_helper.rb
@@ -8,53 +8,4 @@ unless rails_parent
exit
end
end
-# first config rails
-require File.expand_path(rails_parent + "/config/environment")
-# then enable testing, this will get the routing right
-ENV["RAILS_ENV"] = "test"
-require 'test_help'
-
-class ActiveSupport::TestCase
- # Transactional fixtures accelerate your tests by wrapping each test method
- # in a transaction that's rolled back on completion. This ensures that the
- # test database remains unchanged so your fixtures don't have to be reloaded
- # between every test method. Fewer database queries means faster tests.
- #
- # Read Mike Clark's excellent walkthrough at
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
- #
- # Every Active Record database supports transactions except MyISAM tables
- # in MySQL. Turn off transactional fixtures in this case; however, if you
- # don't care one way or the other, switching from MyISAM to InnoDB tables
- # is recommended.
- #
- # The only drawback to using transactional fixtures is when you actually
- # need to test transactions. Since your test is bracketed by a transaction,
- # any transactions started in your code will be automatically rolled back.
- self.use_transactional_fixtures = true
-
- # Instantiated fixtures are slow, but give you @david where otherwise you
- # would need people(:david). If you don't want to migrate your existing
- # test cases which use the @david style and don't mind the speed hit (each
- # instantiated fixtures translates to a database query per test method),
- # then set this back to true.
- self.use_instantiated_fixtures = false
-
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in
alphabetical order.
- #
- # Note: You'll currently still have to declare fixtures explicitly in
integration tests
- # -- they do not yet inherit this setting
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-
- # See http://pennysmalls.com/2009/03/04/rails-23-breakage-and-fixage/
- def clean_backtrace(&block)
- yield
- rescue ActiveSupport::TestCase::Assertion => error
- framework_path =
Regexp.new(File.expand_path("#{File.dirname(__FILE__)}/assertions"))
- error.backtrace.reject! { |line| File.expand_path(line) =~ framework_path }
- raise
- end
-
-end
+require File.expand_path(rails_parent + "/test/test_helper")
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages