Skip to content

Commit 42b6c54

Browse files
committed
Update tests
1 parent dd5c638 commit 42b6c54

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

test/modules/post/test/services.rb

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ def test_info
9494
def test_create
9595
it "should create a service #{datastore["NSERVICE"]}" do
9696
mode = case datastore["MODE"]
97-
when "disable"; 4
98-
when "manual"; 3
99-
when "auto"; 2
100-
else; 2
97+
when "disable"; START_TYPE_DISABLED
98+
when "manual"; START_TYPE_MANUAL
99+
when "auto"; START_TYPE_AUTO
100+
else; START_TYPE AUTO
101101
end
102-
ret = service_create(datastore['NSERVICE'],datastore['DNAME'],datastore['BINPATH'],mode)
102+
103+
ret = service_create(datastore['NSERVICE'],
104+
display: datastore['DNAME'],
105+
path: datastore['BINPATH'],
106+
starttype: mode)
103107

104108
ret == Windows::Error::SUCCESS
105109
end
@@ -148,7 +152,11 @@ def test_change
148152
it "should modify config on a given service #{service_name}" do
149153
ret = true
150154

151-
results = service_create(service_name,display_name,datastore['BINPATH'],START_TYPE_DISABLED)
155+
results = service_create(service_name,
156+
display: display_name,
157+
path: datastore['BINPATH'],
158+
starttype: START_TYPE_DISABLED)
159+
152160
ret &&= (results == Windows::Error::SUCCESS)
153161
results = service_status(service_name)
154162
ret &&= results.kind_of? Hash
@@ -174,7 +182,10 @@ def test_restart_disabled
174182

175183
it "should start a disabled service #{service_name}" do
176184
ret = true
177-
results = service_create(service_name,display_name,datastore['BINPATH'],START_TYPE_DISABLED)
185+
results = service_create(service_name,
186+
display: display_name,
187+
path: datastore['BINPATH'],
188+
starttype: START_TYPE_DISABLED)
178189

179190
ret &&= (results == Windows::Error::SUCCESS)
180191
if ret

0 commit comments

Comments
 (0)