Skip to content

Commit 2b17a04

Browse files
committed
You can't use File.open like that. Broken code.
1 parent 11642dc commit 2b17a04

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/features/support/test_config.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ class TestConfig
55
include Singleton
66

77
def initialize(*args)
8-
if @yaml_options = YAML::load(File.open(File.join(File.dirname(__FILE__),'test_config.yml')))
9-
10-
else
11-
@yaml_options = {}
12-
end
8+
9+
yml_path = File.join(File.dirname(__FILE__),'test_config.yml')
10+
11+
if File.exists?(yml_path)
12+
@yaml_options = YAML::load(File.open(yml_path))
13+
else
14+
@yaml_options = {}
15+
end
1316

1417
@options = {
1518
"rhost" => "localhost",

0 commit comments

Comments
 (0)