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 3434 expect ( result ) . to eq ( true )
3535 end
3636
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
3838 diff = [
3939 '~' ,
4040 "File\f foobar.json" ,
4545 result = subject . filtered? ( diff_obj )
4646 expect ( result ) . to eq ( true )
4747 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
4872 end
4973end
You can’t perform that action at this time.
0 commit comments