|
27 | 27 | end |
28 | 28 |
|
29 | 29 | it 'should contain /tmp/foo1' do |
30 | | - answer = ['~', "File\f/tmp/foo1\fparameters\fcontent", "content of foo-old\n", "content of foo-new\n"] |
31 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 30 | + resource = { |
| 31 | + diff_type: '~', |
| 32 | + type: 'File', |
| 33 | + title: '/tmp/foo1', |
| 34 | + structure: %w(parameters content), |
| 35 | + old_value: "content of foo-old\n", |
| 36 | + new_value: "content of foo-new\n" |
| 37 | + } |
| 38 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
32 | 39 | end |
33 | 40 |
|
34 | 41 | it 'should contain /tmp/binary1' do |
35 | | - answer = [ |
36 | | - '~', |
37 | | - "File\f/tmp/binary1\fparameters\fcontent", |
38 | | - '{md5}e0897d525d5d600a037622b62fc99a4c', |
39 | | - '{md5}97918b387001eb04ae7cb20b13e07f43' |
40 | | - ] |
41 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 42 | + resource = { |
| 43 | + diff_type: '~', |
| 44 | + type: 'File', |
| 45 | + title: '/tmp/binary1', |
| 46 | + structure: %w(parameters content), |
| 47 | + old_value: '{md5}e0897d525d5d600a037622b62fc99a4c', |
| 48 | + new_value: '{md5}97918b387001eb04ae7cb20b13e07f43' |
| 49 | + } |
| 50 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
42 | 51 | end |
43 | 52 |
|
44 | 53 | it 'should contain /tmp/bar2' do |
45 | | - answer = ['~', "File\f/tmp/bar2\fparameters\fcontent", "content of bar\n", "content of new-bar\n"] |
46 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 54 | + resource = { |
| 55 | + diff_type: '~', |
| 56 | + type: 'File', |
| 57 | + title: '/tmp/bar2', |
| 58 | + structure: %w(parameters content), |
| 59 | + old_value: "content of bar\n", |
| 60 | + new_value: "content of new-bar\n" |
| 61 | + } |
| 62 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
47 | 63 | end |
48 | 64 | end |
49 | 65 |
|
|
71 | 87 | end |
72 | 88 |
|
73 | 89 | it 'should contain /tmp/binary1' do |
74 | | - answer = [ |
75 | | - '~', |
76 | | - "File\f/tmp/binary1\fparameters\fsource", |
77 | | - 'puppet:///modules/test/binary-old', |
78 | | - 'puppet:///modules/test/binary-new' |
79 | | - ] |
80 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 90 | + resource = { |
| 91 | + diff_type: '~', |
| 92 | + type: 'File', |
| 93 | + title: '/tmp/binary1', |
| 94 | + structure: %w(parameters source), |
| 95 | + old_value: 'puppet:///modules/test/binary-old', |
| 96 | + new_value: 'puppet:///modules/test/binary-new' |
| 97 | + } |
| 98 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
81 | 99 | end |
82 | 100 |
|
83 | 101 | it 'should contain /tmp/binary3' do |
84 | | - answer = [ |
85 | | - '~', |
86 | | - "File\f/tmp/binary3\fparameters\fsource", |
87 | | - 'puppet:///modules/test/binary-old', |
88 | | - 'puppet:///modules/test/binary-old2' |
89 | | - ] |
90 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 102 | + resource = { |
| 103 | + diff_type: '~', |
| 104 | + type: 'File', |
| 105 | + title: '/tmp/binary3', |
| 106 | + structure: %w(parameters source), |
| 107 | + old_value: 'puppet:///modules/test/binary-old', |
| 108 | + new_value: 'puppet:///modules/test/binary-old2' |
| 109 | + } |
| 110 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
91 | 111 | end |
92 | 112 |
|
93 | 113 | it 'should contain /tmp/foo1' do |
94 | | - answer = ['~', "File\f/tmp/foo1\fparameters\fsource", 'puppet:///modules/test/foo-old', 'puppet:///modules/test/foo-new'] |
95 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 114 | + resource = { |
| 115 | + diff_type: '~', |
| 116 | + type: 'File', |
| 117 | + title: '/tmp/foo1', |
| 118 | + structure: %w(parameters source), |
| 119 | + old_value: 'puppet:///modules/test/foo-old', |
| 120 | + new_value: 'puppet:///modules/test/foo-new' |
| 121 | + } |
| 122 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
96 | 123 | end |
97 | 124 |
|
98 | 125 | it 'should contain /tmp/bar content' do |
99 | | - answer = ['!', "File\f/tmp/bar\fparameters\fcontent", nil, "content of bar\n"] |
100 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 126 | + resource = { |
| 127 | + diff_type: '!', |
| 128 | + type: 'File', |
| 129 | + title: '/tmp/bar', |
| 130 | + structure: %w(parameters content), |
| 131 | + old_value: nil, |
| 132 | + new_value: "content of bar\n" |
| 133 | + } |
| 134 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
101 | 135 | end |
102 | 136 |
|
103 | 137 | it 'should contain /tmp/bar source' do |
104 | | - answer = ['!', "File\f/tmp/bar\fparameters\fsource", 'puppet:///modules/test/bar-old', nil] |
105 | | - expect(OctocatalogDiff::Spec.array_contains_partial_array?(@result[:diffs], answer)).to eq(true) |
| 138 | + resource = { |
| 139 | + diff_type: '!', |
| 140 | + type: 'File', |
| 141 | + title: '/tmp/bar', |
| 142 | + structure: %w(parameters source), |
| 143 | + old_value: 'puppet:///modules/test/bar-old', |
| 144 | + new_value: nil |
| 145 | + } |
| 146 | + expect(OctocatalogDiff::Spec.diff_match?(@result[:diffs], resource)).to eq(true) |
106 | 147 | end |
107 | 148 | end |
108 | 149 |
|
|
0 commit comments