|
21 | 21 | end |
22 | 22 |
|
23 | 23 | it 'should contain the "similar JSON" static file as a diff' do |
24 | | - arr = @result.diffs |
25 | | - answer = ['~', "File\f/tmp/static/similar-yaml.json\fparameters\fcontent"] |
26 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 24 | + resource = { diff_type: '~', type: 'File', title: '/tmp/static/similar-yaml.json', structure: %w(parameters content) } |
| 25 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
27 | 26 | end |
28 | 27 |
|
29 | 28 | it 'should contain the "similar YAML" static file as a diff' do |
30 | | - arr = @result.diffs |
31 | | - answer = ['~', "File\f/tmp/static/similar-yaml.yaml\fparameters\fcontent"] |
32 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 29 | + resource = { diff_type: '~', type: 'File', title: '/tmp/static/similar-yaml.yaml', structure: %w(parameters content) } |
| 30 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
33 | 31 | end |
34 | 32 |
|
35 | 33 | it 'should contain the "similar JSON" template file as a diff' do |
36 | | - arr = @result.diffs |
37 | | - answer = ['~', "File\f/tmp/template/similar-yaml.json\fparameters\fcontent"] |
38 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 34 | + resource = { diff_type: '~', type: 'File', title: '/tmp/template/similar-yaml.json', structure: %w(parameters content) } |
| 35 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
39 | 36 | end |
40 | 37 |
|
41 | 38 | it 'should contain the "similar YAML" template file as a diff' do |
42 | | - arr = @result.diffs |
43 | | - answer = ['~', "File\f/tmp/template/similar-yaml.yaml\fparameters\fcontent"] |
44 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 39 | + resource = { diff_type: '~', type: 'File', title: '/tmp/template/similar-yaml.yaml', structure: %w(parameters content) } |
| 40 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
45 | 41 | end |
46 | 42 | end |
47 | 43 |
|
|
62 | 58 | end |
63 | 59 |
|
64 | 60 | it 'should contain the "similar JSON" static file as a diff' do |
65 | | - arr = @result.diffs |
66 | | - answer = ['~', "File\f/tmp/static/similar-yaml.json\fparameters\fcontent"] |
67 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 61 | + resource = { diff_type: '~', type: 'File', title: '/tmp/static/similar-yaml.json', structure: %w(parameters content) } |
| 62 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
68 | 63 | end |
69 | 64 |
|
70 | 65 | it 'should not contain the "similar YAML" static file as a diff' do |
71 | | - arr = @result.diffs |
72 | | - answer = ['~', "File\f/tmp/static/similar-yaml.yaml\fparameters\fcontent"] |
73 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(false) |
| 66 | + resource = { diff_type: '~', type: 'File', title: '/tmp/static/similar-yaml.yaml', structure: %w(parameters content) } |
| 67 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(false) |
74 | 68 | end |
75 | 69 |
|
76 | 70 | it 'should contain the "similar JSON" template file as a diff' do |
77 | | - arr = @result.diffs |
78 | | - answer = ['~', "File\f/tmp/template/similar-yaml.json\fparameters\fcontent"] |
79 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(true) |
| 71 | + resource = { diff_type: '~', type: 'File', title: '/tmp/template/similar-yaml.json', structure: %w(parameters content) } |
| 72 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(true) |
80 | 73 | end |
81 | 74 |
|
82 | 75 | it 'should not contain the "similar YAML" template file as a diff' do |
83 | | - arr = @result.diffs |
84 | | - answer = ['~', "File\f/tmp/template/similar-yaml.yaml\fparameters\fcontent"] |
85 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(arr, answer)).to eq(false) |
| 76 | + resource = { diff_type: '~', type: 'File', title: '/tmp/template/similar-yaml.yaml', structure: %w(parameters content) } |
| 77 | + expect(OctocatalogDiff::Spec.diff_match?(@result.diffs, resource)).to eq(false) |
86 | 78 | end |
87 | 79 | end |
88 | 80 | end |
0 commit comments