File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,8 @@ By default the tests run with the Identity Map turned off. But all tests should
32
32
not the identity map is on or off. You can turn it on using the IM env variable:
33
33
34
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