Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2342 Bytes
1 | unless defined? TEST_ROOT |
2 | ENV["RAILS_ENV"] = "test" |
3 | |
4 | require 'test/unit' |
5 | |
6 | TEST_ROOT = File.expand_path(File.dirname(__FILE__)) |
7 | |
8 | unless defined? RADIANT_ROOT |
9 | if env_file = ENV["RADIANT_ENV_FILE"] |
10 | require env_file |
11 | else |
12 | require File.expand_path(TEST_ROOT + "/../config/environment") |
13 | end |
14 | end |
15 | require 'test_help' |
16 | |
17 | class ActiveSupport::TestCase |
18 | # Transactional fixtures accelerate your tests by wrapping each test method |
19 | # in a transaction that's rolled back on completion. This ensures that the |
20 | # test database remains unchanged so your fixtures don't have to be reloaded |
21 | # between every test method. Fewer database queries means faster tests. |
22 | # |
23 | # Read Mike Clark's excellent walkthrough at |
24 | # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting |
25 | # |
26 | # Every Active Record database supports transactions except MyISAM tables |
27 | # in MySQL. Turn off transactional fixtures in this case; however, if you |
28 | # don't care one way or the other, switching from MyISAM to InnoDB tables |
29 | # is recommended. |
30 | self.use_transactional_fixtures = true |
31 | |
32 | # Instantiated fixtures are slow, but give you @david where otherwise you |
33 | # would need people(:david). If you don't want to migrate your existing |
34 | # test cases which use the @david style and don't mind the speed hit (each |
35 | # instantiated fixtures translates to a database query per test method), |
36 | # then set this back to true. |
37 | self.use_instantiated_fixtures = false |
38 | |
39 | # Make sure instance installs know where fixtures are |
40 | self.fixture_path = ["#{TEST_ROOT}/fixtures"] |
41 | |
42 | class << self |
43 | # Class method for test helpers |
44 | def test_helper(*names) |
45 | names.each do |name| |
46 | name = name.to_s |
47 | name = $1 if name =~ /^(.*?)_test_helper$/i |
48 | name = name.singularize |
49 | first_time = true |
50 | begin |
51 | constant = (name.camelize + 'TestHelper').constantize |
52 | self.class_eval { include constant } |
53 | rescue NameError |
54 | filename = File.expand_path(TEST_ROOT + '/helpers/' + name + '_test_helper.rb') |
55 | require filename if first_time |
56 | first_time = false |
57 | retry |
58 | end |
59 | end |
60 | end |
61 | alias :test_helpers :test_helper |
62 | end |
63 | end |
64 | end |