Skip to content

Commit

Permalink
Merge pull request #183 from mihaibuzgau/master
Browse files Browse the repository at this point in the history
(maint) Merge 1.6.x to master
  • Loading branch information
DavidS authored Jun 12, 2019
2 parents d249941 + b1404de commit 4836e85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/puppet/resource_api/glue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def to_json(*)
resource.to_json
end

def to_hash
values
end

# attribute names that are not title or namevars
def filtered_keys
values.keys.reject { |k| k == :title || !attr_def[k] || (attr_def[k][:behaviour] == :namevar && @namevars.size == 1) }
Expand Down
4 changes: 4 additions & 0 deletions spec/puppet/resource_api/glue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,9 @@
it { expect(instance.to_hierayaml).to eq " ? |-\n foo:\n bar\n : attr: value\n attr_ro: fixed\n" }
end
end

describe '.to_hash' do
it { expect(instance.to_hash).to eq(namevarname: 'title', attr: 'value', attr_ro: 'fixed') }
end
end
end

0 comments on commit 4836e85

Please sign in to comment.