Skip to content

Commit 8633e94

Browse files
committed
(PUP-12077) Clean up rich_data resource specs
1 parent 9f61d16 commit 8633e94

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: spec/unit/resource_spec.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -910,14 +910,15 @@ def inject_and_set_defaults(resource, scope)
910910
require 'puppet_spec/compiler'
911911
include PuppetSpec::Compiler
912912

913-
it 'should do something' do
913+
it 'serializes rich data' do
914914
resource = compile_to_catalog('notify {"foo": message => Deferred("func", ["a", "b", "c"])}')
915915

916-
# This should be true by default
917-
if Puppet[:rich_data]
918-
expect(resource.to_data_hash.class).to be(Hash)
919-
end
916+
# This assume rich_data is true by default
917+
expect(resource.to_data_hash.class).to be(Hash)
918+
end
920919

920+
it 'raises when rich data is disabled' do
921+
resource = compile_to_catalog('notify {"foo": message => Deferred("func", ["a", "b", "c"])}')
921922
expect {
922923
Puppet.override(rich_data: false) do
923924
resource.to_data_hash

0 commit comments

Comments
 (0)