File tree Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,31 @@ You can build postgres and mysql databases using the build_postgresql and build_
9
9
10
10
You can run a particular test file from the command line, e.g.
11
11
12
- $ ruby test/cases/base_test.rb
12
+ $ ruby -Itest test/cases/base_test.rb
13
13
14
14
To run a specific test:
15
15
16
- $ ruby test/cases/base_test.rb -n test_something_works
16
+ $ ruby -Itest test/cases/base_test.rb -n test_something_works
17
17
18
18
You can run with a database other than the default you set in test/config.yml, using the ARCONN
19
19
environment variable:
20
20
21
- $ ARCONN=postgresql ruby test/cases/base_test.rb
21
+ $ ARCONN=postgresql ruby -Itest test/cases/base_test.rb
22
22
23
23
You can run all the tests for a given database via rake:
24
24
25
- $ rake test_postgresql
25
+ $ rake test_mysql
26
+
27
+ The 'rake test' task will run all the tests for mysql, mysql2, sqlite3 and postgresql.
28
+
29
+ == Identity Map
30
+
31
+ By default the tests run with the Identity Map turned off. But all tests should pass whether or
32
+ not the identity map is on or off. You can turn it on using the IM env variable:
33
+
34
+ $ IM=true ruby -Itest test/case/base_test.rb
35
+
36
+ == Config file
37
+
38
+ By default, the config file is expected to be at the path test/config.yml. You can specify a
39
+ custom location with the ARCONFIG environment variable.
Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ def config
10
10
11
11
private
12
12
13
+ def config_file
14
+ Pathname . new ( ENV [ 'ARCONFIG' ] || TEST_ROOT + '/config.yml' )
15
+ end
16
+
13
17
def read_config
14
- unless File . exist? ( TEST_ROOT + '/config.yml' )
15
- FileUtils . cp TEST_ROOT + '/config.example.yml' , TEST_ROOT + '/config.yml'
18
+ unless config_file . exist?
19
+ FileUtils . cp TEST_ROOT + '/config.example.yml' , config_file
16
20
end
17
21
18
- raw = File . read ( TEST_ROOT + '/config.yml' )
19
- erb = Erubis ::Eruby . new ( raw )
22
+ erb = Erubis ::Eruby . new ( config_file . read )
20
23
expand_config ( YAML . parse ( erb . result ( binding ) ) . transform )
21
24
end
22
25
You can’t perform that action at this time.
0 commit comments