Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 4
- Log:
Initial import of Radiant 0.50 sources from a downloaded Tarball.
Radiant is a Ruby On Rails based lightweight content management
system.
- Author:
- adh
- Date:
- Sat Jul 22 16:47:40 +0100 2006
- Size:
- 2105 Bytes
1 | unless defined? TEST_ROOT |
2 | ENV["RAILS_ENV"] = "test" |
3 | |
4 | require 'pathname' |
5 | TEST_ROOT = Pathname.new(File.expand_path(File.dirname(__FILE__))).cleanpath(true).to_s |
6 | |
7 | require TEST_ROOT + "/../config/environment" |
8 | require 'test_help' |
9 | |
10 | class Test::Unit::TestCase |
11 | # Transactional fixtures accelerate your tests by wrapping each test method |
12 | # in a transaction that's rolled back on completion. This ensures that the |
13 | # test database remains unchanged so your fixtures don't have to be reloaded |
14 | # between every test method. Fewer database queries means faster tests. |
15 | # |
16 | # Read Mike Clark's excellent walkthrough at |
17 | # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting |
18 | # |
19 | # Every Active Record database supports transactions except MyISAM tables |
20 | # in MySQL. Turn off transactional fixtures in this case; however, if you |
21 | # don't care one way or the other, switching from MyISAM to InnoDB tables |
22 | # is recommended. |
23 | self.use_transactional_fixtures = true |
24 | |
25 | # Instantiated fixtures are slow, but give you @david where otherwise you |
26 | # would need people(:david). If you don't want to migrate your existing |
27 | # test cases which use the @david style and don't mind the speed hit (each |
28 | # instantiated fixtures translates to a database query per test method), |
29 | # then set this back to true. |
30 | self.use_instantiated_fixtures = false |
31 | |
32 | class << self |
33 | # Class method for test helpers |
34 | def test_helper(*names) |
35 | names.each do |name| |
36 | name = name.to_s |
37 | name = $1 if name =~ /^(.*?)_test_helper$/i |
38 | name = name.singularize |
39 | first_time = true |
40 | begin |
41 | constant = (name.camelize + 'TestHelper').constantize |
42 | self.class_eval { include constant } |
43 | rescue NameError |
44 | filename = File.expand_path(TEST_ROOT + '/helpers/' + name + '_test_helper.rb') |
45 | require filename if first_time |
46 | first_time = false |
47 | retry |
48 | end |
49 | end |
50 | end |
51 | alias :test_helpers :test_helper |
52 | end |
53 | end |
54 | end |