diff --git a/lib/puppet.rb b/lib/puppet.rb index 484fda4c4ef..e80248b86c9 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -237,7 +237,7 @@ def self.base_context(settings) :ssl_context => proc { Puppet.runtime[:http].default_ssl_context }, :http_session => proc { Puppet.runtime[:http].create_session }, :plugins => proc { Puppet::Plugins::Configuration.load_plugins }, - :rich_data => false + :rich_data => proc { Puppet.lookup(:current_environment).rich_data? } } end diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index c527358e3f6..a351b23cae2 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -906,6 +906,12 @@ def inject_and_set_defaults(resource, scope) # Note: to_stringified_spec.rb has tests for all other data types end + # Try something like + # include PuppetSpec::Compiler + # Puppet[:rich_data] = true|false + # resource (?) = evaluate('Deferred("func", ["a", "b", "c"])') + # resource.to_data_hash() + describe "when converting from json" do before do @data = {