File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
spec/unit/puppet/provider/file_line Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 235
235
end
236
236
end
237
237
end
238
+ describe 'MODULES-5651' do
239
+ let ( :params ) { {
240
+ line : 'LogLevel=notice' ,
241
+ match : '^#LogLevel$' ,
242
+ } }
243
+ context "match, no line" do
244
+ let ( :content ) { "#LogLevel\n stuff" }
245
+ it 'requests changes' do
246
+ expect ( provider . exists? ) . to be_falsy
247
+ end
248
+ it 'replaces the match' do
249
+ provider . create
250
+ expect ( File . read ( tmpfile ) . chomp ) . to eq ( "LogLevel=notice\n stuff" )
251
+ end
252
+ end
253
+ context "match, line" do
254
+ let ( :content ) { "#Loglevel\n LogLevel=notice\n stuff" }
255
+ it 'does not request changes' do
256
+ expect ( provider . exists? ) . to be_truthy
257
+ end
258
+ end
259
+ context "no match, line" do
260
+ let ( :content ) { "LogLevel=notice\n stuff" }
261
+ it 'does not request changes' do
262
+ expect ( provider . exists? ) . to be_truthy
263
+ end
264
+ end
265
+ end
238
266
end
239
267
describe "#create" do
240
268
context "when adding" do
You can’t perform that action at this time.
0 commit comments