File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
spec/octocatalog-diff/tests/catalog-diff/filter Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 34
34
expect ( result ) . to eq ( true )
35
35
end
36
36
37
- it 'should filter when from -catalog has string and to -catalog has array with that string' do
37
+ it 'should filter when to -catalog has string and from -catalog has array with that string' do
38
38
diff = [
39
39
'~' ,
40
40
"File\f foobar.json" ,
45
45
result = subject . filtered? ( diff_obj )
46
46
expect ( result ) . to eq ( true )
47
47
end
48
+
49
+ it 'should not filter when from-catalog has string and to-catalog has array with a different string' do
50
+ diff = [
51
+ '~' ,
52
+ "File\f foobar.json" ,
53
+ { 'parameters' => { 'notify' => 'Service[bar]' } } ,
54
+ { 'parameters' => { 'notify' => [ 'Service[foo]' ] } }
55
+ ]
56
+ diff_obj = OctocatalogDiff ::API ::V1 ::Diff . new ( diff )
57
+ result = subject . filtered? ( diff_obj )
58
+ expect ( result ) . to eq ( false )
59
+ end
60
+
61
+ it 'should not filter when to-catalog has string and from-catalog has array with a different string' do
62
+ diff = [
63
+ '~' ,
64
+ "File\f foobar.json" ,
65
+ { 'parameters' => { 'notify' => [ 'Service[foo]' ] } } ,
66
+ { 'parameters' => { 'notify' => 'Service[bar]' } }
67
+ ]
68
+ diff_obj = OctocatalogDiff ::API ::V1 ::Diff . new ( diff )
69
+ result = subject . filtered? ( diff_obj )
70
+ expect ( result ) . to eq ( false )
71
+ end
48
72
end
49
73
end
You can’t perform that action at this time.
0 commit comments