File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ def insync?(value)
176
176
def should_to_s ( value )
177
177
( @resource . behaviors [ :on_should_to_s ] || proc { "'#{ value } '" } ) . call
178
178
end
179
+
180
+ def change_to_s ( value , should )
181
+ "some custom insync message"
182
+ end
179
183
end
180
184
181
185
newparam ( :name ) do
@@ -249,6 +253,7 @@ def self.name
249
253
expect ( status . events [ 0 ] . property ) . to eq ( 'ensure' )
250
254
expect ( status . events [ 0 ] . name . to_s ) . to eq ( 'Testing_created' )
251
255
expect ( status . events [ 0 ] . status ) . to eq ( 'success' )
256
+ expect ( status . events [ 0 ] . message ) . to eq 'some custom insync message'
252
257
end
253
258
254
259
it "ensure is in sync means that the rest *does* happen" do
@@ -283,6 +288,14 @@ def self.name
283
288
expect ( testing_errors [ 0 ] . message ) . not_to be_nil
284
289
expect ( resource_errors [ 0 ] . message ) . not_to eq ( "Puppet::Util::Log requires a message" )
285
290
end
291
+
292
+ it "displays custom insync message in noop" do
293
+ resource = an_ensurable_resource_reacting_as ( :present? => true )
294
+ resource [ :noop ] = true
295
+ status = @harness . evaluate ( resource )
296
+ sync_event = status . events [ 0 ]
297
+ expect ( sync_event . message ) . to eq 'some custom insync message (noop)'
298
+ end
286
299
end
287
300
288
301
describe "when a caught error occurs" do
You can’t perform that action at this time.
0 commit comments