1 unless defined? SPEC_ROOT
2 ENV["RAILS_ENV"] = "test"
4 SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
6 unless defined? RADIANT_ROOT
7 if env_file = ENV["RADIANT_ENV_FILE"]
10 require File.expand_path(SPEC_ROOT + "/../config/environment")
17 class Test::Unit::TestCase
19 # Class method for test helpers
20 def test_helper(*names)
23 name = $1 if name =~ /^(.*?)_test_helper$/i
24 name = name.singularize
27 constant = (name.camelize + 'TestHelper').constantize
28 self.class_eval { include constant }
30 filename = File.expand_path(SPEC_ROOT + '/../test/helpers/' + name + '_test_helper.rb')
31 require filename if first_time
37 alias :test_helpers :test_helper
41 Dir[RAILS_ROOT + '/spec/matchers/*_matcher.rb'].each do |matcher|
45 Spec::Runner.configure do |config|
46 config.use_transactional_fixtures = true
47 config.use_instantiated_fixtures = false
48 config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
50 # You can declare fixtures for each behaviour like this:
52 # fixtures :table_a, :table_b
54 # Alternatively, if you prefer to declare them only once, you can
55 # do so here, like so ...
57 # config.global_fixtures = :table_a, :table_b
59 # If you declare global fixtures, be aware that they will be declared
60 # for all of your examples, even those that don't use them.