spec/unit/provider/ohai_spec.rb in chef-10.34.6 vs spec/unit/provider/ohai_spec.rb in chef-11.0.0.beta.0
- old
+ new
@@ -32,11 +32,11 @@
:fqdn => @fqdn,
:hostname => @hostname,
:platform => @platform,
:platform_version => @platform_version,
:data => {
- :origdata => "somevalue"
+ :origdata => "somevalue"
},
:data2 => {
:origdata => "somevalue",
:newdata => "somevalue"
}
@@ -47,25 +47,25 @@
mock_ohai[:data2])
Ohai::System.stub!(:new).and_return(mock_ohai)
Chef::Platform.stub!(:find_platform_and_version).and_return({ "platform" => @platform,
"platform_version" => @platform_version})
# Fake node with a dummy save
- @node = Chef::Node.new(@hostname)
+ @node = Chef::Node.new
@node.name(@fqdn)
@node.stub!(:save).and_return(@node)
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Ohai.new("ohai_reload")
ohai = Ohai::System.new
ohai.all_plugins
- @node.process_external_attrs(ohai.data,{})
+ @node.consume_external_attrs(ohai.data,{})
@provider = Chef::Provider::Ohai.new(@new_resource, @run_context)
end
describe "when reloading ohai" do
before do
- @node[:origdata] = 'somevalue'
+ @node.automatic_attrs[:origdata] = 'somevalue'
end
it "applies updated ohai data to the node" do
@node[:origdata].should == 'somevalue'
@node[:newdata].should be_nil