|
1251 | 1251 | expect(result[0]).to eq(['!', "Class\fOpenssl::Package\fparameters\fcommon-array", [1, 2, 3], [1, 5, 25], fileref, fileref]) |
1252 | 1252 | end |
1253 | 1253 | end |
1254 | | - |
1255 | | - describe '#filter_diffs_for_absent_files' do |
1256 | | - before(:each) do |
1257 | | - empty_puppet_catalog_json = File.read(OctocatalogDiff::Spec.fixture_path('catalogs/catalog-empty.json')) |
1258 | | - empty_puppet_catalog = OctocatalogDiff::Catalog.new(json: empty_puppet_catalog_json) |
1259 | | - logger, @logger_str = OctocatalogDiff::Spec.setup_logger |
1260 | | - @obj = OctocatalogDiff::CatalogDiff::Differ.new({ logger: logger }, empty_puppet_catalog, empty_puppet_catalog) |
1261 | | - @orig = [ |
1262 | | - ['~', "File\f/tmp/foo\fparameters\fensure", 'file', 'absent'], |
1263 | | - ['~', "File\f/tmp/foo\fparameters\fowner", 'root', 'nobody'], |
1264 | | - ['~', "File\f/tmp/foo\fparameters\fbackup", true, nil], |
1265 | | - ['~', "File\f/tmp/foo\fparameters\fforce", false, nil], |
1266 | | - ['~', "File\f/tmp/foo\fparameters\fprovider", 'root', nil], |
1267 | | - ['~', "File\f/tmp/bar\fparameters\fensure", 'file', 'link'], |
1268 | | - ['~', "File\f/tmp/bar\fparameters\ftarget", nil, '/tmp/foo'], |
1269 | | - ['~', "Exec\f/tmp/bar\fparameters\fcommand", nil, '/tmp/foo'] |
1270 | | - ] |
1271 | | - @result = @orig.dup |
1272 | | - @obj.send(:filter_diffs_for_absent_files, @result) |
1273 | | - end |
1274 | | - |
1275 | | - it 'should filter out some attributes for ensure=>absent file' do |
1276 | | - expect(@result).to eq(@orig.values_at(0, 2, 3, 4, 5, 6, 7)) |
1277 | | - end |
1278 | | - |
1279 | | - it 'should log messages' do |
1280 | | - expect(@logger_str.string).to match(/Entering filter_diffs_for_absent_files with 8 diffs/) |
1281 | | - expect(@logger_str.string).to match(%r{Removing file=/tmp/foo parameter=owner for absent file}) |
1282 | | - expect(@logger_str.string).to match(/Exiting filter_diffs_for_absent_files with 7 diffs/) |
1283 | | - end |
1284 | | - end |
1285 | 1254 | end |
0 commit comments