Skip to content

Commit

Permalink
remove test setup file (and thus, test run options)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Fuchs committed Nov 17, 2010
1 parent bec97b8 commit 8703ca0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 84 deletions.
21 changes: 2 additions & 19 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,8 @@ h2. Tests
You can run tests both with

* `rake test` or just `rake`
* run any test file directly, e.g. `ruby test/api/simple_test.rb`
* run all tests with `ruby test/all.rb`

You can parametrize the test suite for using different sets of dependencies by
using:

.pre `ruby test/all.rb -w DEPENDENCIES`

... where DEPENDENCIES is a comma-separated list of:

* r23 or rails-2.3.x
* r3 or rails-3.x
* no-rails
* sqlite
* mysql

So, e.g. this would run the test suite against Rails 2.3.x using mysql:

.pre `ruby test/all.rb -w r23,mysql`
* run any test file directly, e.g. `ruby -Itest test/api/simple_test.rb`
* run all tests with `ruby -Itest test/all.rb`

The structure of the test suite is a bit unusual as it uses modules to reuse
particular tests in different test cases.
Expand Down
28 changes: 26 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
require 'test_setup'
$KCODE = 'u' if RUBY_VERSION <= '1.9'

I18n::Tests.parse_options!
require 'rubygems'
require 'test/unit'

# Do not load the i18n gem from libraries like active_support.
#
# This is required for testing against Rails 2.3 because active_support/vendor.rb#24 tries
# to load I18n using the gem method. Instead, we want to test the local library of course.
alias :gem_for_ruby_19 :gem # for 1.9. gives a super ugly seg fault otherwise
def gem(gem_name, *version_requirements)
puts("skipping loading the i18n gem ...") && return if gem_name =='i18n'
super(gem_name, *version_requirements)
end

require 'bundler/setup'
require 'i18n'
require 'mocha'
require 'test_declarative'

class Test::Unit::TestCase
def teardown
Expand All @@ -26,6 +42,14 @@ def locales_dir
end
end

module Kernel
def setup_rufus_tokyo
require 'rufus/tokyo'
rescue LoadError => e
puts "can't use KeyValue backend because: #{e.message}"
end
end

Object.class_eval do
def meta_class
class << self; self; end
Expand Down
63 changes: 0 additions & 63 deletions test/test_setup.rb

This file was deleted.

0 comments on commit 8703ca0

Please sign in to comment.