File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "document_type" : " Catalog" ,
3+ "data" : {
4+ "tags" : [" settings" ],
5+ "name" : " my.rspec.node" ,
6+ "version" : " production" ,
7+ "environment" : " production" ,
8+ "resources" : [
9+ {
10+ "type" : " Stage" ,
11+ "title" : " main" ,
12+ "tags" : [" stage" ],
13+ "exported" : false ,
14+ "parameters" : {
15+ "name" : " main"
16+ }
17+ },
18+ {
19+ "type" : " Class" ,
20+ "title" : " Settings" ,
21+ "tags" : [" class" ," settings" ],
22+ "exported" : false
23+ },
24+ {
25+ "type" : " File" ,
26+ "title" : " /tmp/foo" ,
27+ "tags" : [" tag-one-new" ," tag-too" ],
28+ "parameters" : {
29+ "content" : " foofoo" ,
30+ "owner" : " root"
31+ }
32+ }
33+ ],
34+ "classes" : [
35+ " settings"
36+ ]
37+ },
38+ "metadata" : {
39+ "api_version" : 1
40+ }
41+ }
Original file line number Diff line number Diff line change 1+ {
2+ "document_type" : " Catalog" ,
3+ "data" : {
4+ "tags" : [" settings" ],
5+ "name" : " my.rspec.node" ,
6+ "version" : " production" ,
7+ "environment" : " production" ,
8+ "resources" : [
9+ {
10+ "type" : " Stage" ,
11+ "title" : " main" ,
12+ "tags" : [" stage" ],
13+ "exported" : false ,
14+ "parameters" : {
15+ "name" : " main"
16+ }
17+ },
18+ {
19+ "type" : " Class" ,
20+ "title" : " Settings" ,
21+ "tags" : [" class" ," settings" ],
22+ "exported" : false
23+ },
24+ {
25+ "type" : " File" ,
26+ "title" : " /tmp/foo" ,
27+ "tags" : [" tag-one" ," tag-two" ],
28+ "parameters" : {
29+ "content" : " foofoo" ,
30+ "owner" : " root"
31+ }
32+ }
33+ ],
34+ "classes" : [
35+ " settings"
36+ ]
37+ },
38+ "metadata" : {
39+ "api_version" : 1
40+ }
41+ }
Original file line number Diff line number Diff line change 44require 'json'
55
66describe 'include-tags integration' do
7+ let ( :default_argv ) do
8+ [
9+ '--from-catalog' , OctocatalogDiff ::Spec . fixture_path ( 'catalogs/include-tags-old.json' ) ,
10+ '--to-catalog' , OctocatalogDiff ::Spec . fixture_path ( 'catalogs/include-tags-new.json' )
11+ ]
12+ end
13+
714 context 'with --include-tags specified' do
15+ let ( :argv ) do
16+ default_argv . concat [ '--include-tags' ]
17+ end
18+
19+ let ( :result ) do
20+ OctocatalogDiff ::Integration . integration (
21+ argv : argv
22+ )
23+ end
24+
25+ it 'should exit indicating success with differences' do
26+ expect ( result . exitcode ) . to eq ( 2 )
27+ end
28+
29+ it 'should contain representative tag differences' do
30+ diffs = result . diffs
31+ expect ( diffs . size ) . to eq ( 1 )
32+ expect ( diffs . first . change? ) . to eq ( true )
33+ expect ( diffs . first . structure ) . to eq ( [ 'tags' ] )
34+ expect ( diffs . first . old_value ) . to eq ( [ 'tag-one' , 'tag-two' ] )
35+ expect ( diffs . first . new_value ) . to eq ( [ 'tag-one-new' , 'tag-too' ] )
36+ end
837 end
938
1039 context 'with --no-include-tags specified' do
You can’t perform that action at this time.
0 commit comments