|
165 | 165 | diff_obj = OctocatalogDiff::API::V1::Diff.factory(diff)
|
166 | 166 | expect(subject.filtered?(diff_obj, opts)).to eq(false)
|
167 | 167 | end
|
| 168 | + |
| 169 | + it 'should remove a change where directories appear more than one time' do |
| 170 | + diff = [ |
| 171 | + '~', |
| 172 | + "Varies_Due_To_Compilation_Dir_3\fCommon Title\fparameters\fdir", |
| 173 | + 'command -a /path/to/catalog1/something -b common-stuff -a /path/to/catalog1/otherthing', |
| 174 | + 'command -a /path/to/catalog2/something -b common-stuff -a /path/to/catalog2/otherthing', |
| 175 | + { 'file' => nil, 'line' => nil }, |
| 176 | + { 'file' => nil, 'line' => nil } |
| 177 | + ] |
| 178 | + diff_obj = OctocatalogDiff::API::V1::Diff.factory(diff) |
| 179 | + expect(subject.filtered?(diff_obj, opts)).to eq(true) |
| 180 | + end |
168 | 181 | end
|
169 | 182 |
|
170 | 183 | context '~ partial indeterminate matches' do
|
|
190 | 203 | expect(@logger_str.string).to match(/WARN.*Varies_Due_To_Compilation_Dir_3\[Common Title\] parameters => dir.+differences/)
|
191 | 204 | end
|
192 | 205 | end
|
| 206 | + |
| 207 | + context '~ array value changes' do |
| 208 | + let(:diff) do |
| 209 | + [ |
| 210 | + '~', |
| 211 | + "Varies_Due_To_Compilation_Dir_3\fCommon Title\fparameters\fdir", |
| 212 | + ['something that doesn\'t change', '/path/to/catalog1', 'something else'], |
| 213 | + ['something that doesn\'t change', '/path/to/catalog2', 'something else'], |
| 214 | + { 'file' => nil, 'line' => nil }, |
| 215 | + { 'file' => nil, 'line' => nil } |
| 216 | + ] |
| 217 | + end |
| 218 | + |
| 219 | + it 'should remove a change where directories are a full match' do |
| 220 | + diff_obj = OctocatalogDiff::API::V1::Diff.factory(diff) |
| 221 | + expect(subject.filtered?(diff_obj, opts)).to eq(true) |
| 222 | + end |
| 223 | + end |
| 224 | + |
| 225 | + context '~ nested hash changes' do |
| 226 | + let(:diff) do |
| 227 | + [ |
| 228 | + '~', |
| 229 | + "Varies_Due_To_Compilation_Dir_3\fCommon Title\fparameters\fdir", |
| 230 | + { 'value' => { 'path' => ['thing', '/path/to/catalog1/file', 'otherthing'] } }, |
| 231 | + { 'value' => { 'path' => ['thing', '/path/to/catalog2/file', 'otherthing'] } }, |
| 232 | + { 'file' => nil, 'line' => nil }, |
| 233 | + { 'file' => nil, 'line' => nil } |
| 234 | + ] |
| 235 | + end |
| 236 | + |
| 237 | + it 'should remove a change where directories are a full match' do |
| 238 | + diff_obj = OctocatalogDiff::API::V1::Diff.factory(diff) |
| 239 | + expect(subject.filtered?(diff_obj, opts)).to eq(true) |
| 240 | + end |
| 241 | + end |
193 | 242 | end
|
0 commit comments