File tree Expand file tree Collapse file tree
lib/octocatalog-diff/api/v1
spec/octocatalog-diff/tests/api/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ Returns true if this diff is an addition (resource exists in new catalog but not
1616
1717Returns true if this diff is a change (resource exists in both catalogs but is different between them).
1818
19- #### ` #change_type ` (String)
19+ #### ` #diff_type ` (String)
2020
21- Returns the change type of the diff , which is one of the following characters:
21+ Returns the type of difference , which is one of the following characters:
2222
2323- ` + ` for addition (resource exists in new catalog but not old catalog)
2424- ` - ` for removal (resource exists in old catalog but not new catalog)
@@ -229,7 +229,7 @@ Returns the title of the resource from the Puppet catalog.
229229For example, a diff involving ` File['/etc/passwd'] ` would have:
230230
231231- ` diff.title #=> '/etc/passwd' `
232- - ` diff.type #=> 'File `
232+ - ` diff.type #=> 'File' `
233233
234234#### ` #type ` (String)
235235
@@ -238,7 +238,7 @@ Returns the type of the resource from the Puppet catalog.
238238For example, a diff involving ` File['/etc/passwd'] ` would have:
239239
240240- ` diff.title #=> '/etc/passwd' `
241- - ` diff.type #=> 'File `
241+ - ` diff.type #=> 'File' `
242242
243243Note that the type will be capitalized because Puppet capitalizes this in catalogs.
244244
Original file line number Diff line number Diff line change @@ -36,26 +36,26 @@ def [](i)
3636
3737 # Public: Get the change type
3838 # @return [String] Change type symbol (~, !, +, -)
39- def change_type
39+ def diff_type
4040 @raw [ 0 ]
4141 end
4242
4343 # Public: Is this an addition?
4444 # @return [Boolean] True if this is an addition
4545 def addition?
46- change_type == '+'
46+ diff_type == '+'
4747 end
4848
4949 # Public: Is this a removal?
5050 # @return [Boolean] True if this is an addition
5151 def removal?
52- change_type == '-'
52+ diff_type == '-'
5353 end
5454
5555 # Public: Is this a change?
5656 # @return [Boolean] True if this is an change
5757 def change?
58- change_type == '~' || change_type == '!'
58+ diff_type == '~' || diff_type == '!'
5959 end
6060
6161 # Public: Get the resource type
@@ -123,7 +123,7 @@ def new_line
123123 # @return [Hash] Hash with keys set by these methods
124124 def to_h
125125 {
126- change_type : change_type ,
126+ diff_type : diff_type ,
127127 type : type ,
128128 title : title ,
129129 structure : structure ,
Original file line number Diff line number Diff line change 4242 end
4343 end
4444
45- describe '#change_type ' do
45+ describe '#diff_type ' do
4646 it 'should identify the symbol' do
4747 testobj = described_class . new ( chg_2 )
48- expect ( testobj . change_type ) . to eq ( '~' )
48+ expect ( testobj . diff_type ) . to eq ( '~' )
4949 end
5050 end
5151
275275
276276 describe '#to_h' do
277277 it 'should return a hash with the expected keys and values' do
278- methods = %w( change_type type title structure old_value new_value old_line new_line old_file new_file )
278+ methods = %w( diff_type type title structure old_value new_value old_line new_line old_file new_file )
279279 testobj = described_class . new ( chg_2 )
280280 result = testobj . to_h
281281 methods . each do |method_name |
You can’t perform that action at this time.
0 commit comments