Skip to content

Commit f332d30

Browse files
psavides-awsDa Wang
authored andcommitted
Fix Default Config Test Case to Work With Windows Config
1 parent b0e561a commit f332d30

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/instance_agent/config_test.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,15 @@ class InstanceAgentConfigTest < InstanceAgentTestCase
136136
should 'load the default config file' do
137137
InstanceAgent::Config.config[:config_file] = default_config_path
138138

139-
assert_equal(nil, InstanceAgent::Config.config[:max_revisions])
139+
expected_log_dir = if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
140+
"Amazon/CodeDeploy/log"
141+
else
142+
"/var/log/aws/codedeploy-agent/"
143+
end
144+
145+
assert_equal("/tmp", InstanceAgent::Config.config[:log_dir])
140146
InstanceAgent::Config.load_config
141-
142-
assert_equal(5, InstanceAgent::Config.config[:max_revisions])
147+
assert_equal(expected_log_dir, InstanceAgent::Config.config[:log_dir])
143148
end
144149

145150
should 'include a newline at the end of the file' do

0 commit comments

Comments
 (0)