@@ -94,12 +94,16 @@ def test_info
94
94
def test_create
95
95
it "should create a service #{ datastore [ "NSERVICE" ] } " do
96
96
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
101
101
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 )
103
107
104
108
ret == Windows ::Error ::SUCCESS
105
109
end
@@ -148,7 +152,11 @@ def test_change
148
152
it "should modify config on a given service #{ service_name } " do
149
153
ret = true
150
154
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
+
152
160
ret &&= ( results == Windows ::Error ::SUCCESS )
153
161
results = service_status ( service_name )
154
162
ret &&= results . kind_of? Hash
@@ -174,7 +182,10 @@ def test_restart_disabled
174
182
175
183
it "should start a disabled service #{ service_name } " do
176
184
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 )
178
189
179
190
ret &&= ( results == Windows ::Error ::SUCCESS )
180
191
if ret
0 commit comments