[chef-dev] CHEF-3237: code review + help needed for rspec test


Chronological Thread 
  • From: Ringo De Smet < >
  • To: Chef Dev < >
  • Subject: [chef-dev] CHEF-3237: code review + help needed for rspec test
  • Date: Tue, 5 Feb 2013 17:23:10 +0100

Hello,

I am trying to fix CHEF-3237 based on the suggestion of Bryan McLellan to check for the existence of the HOME environment variable rather than checking for root.


I have changed some code and tried to add an RSpec test to it, but I'm failing miserably on that part.


Two questions:

1) Can someone review my changes for the Mac OS X service provider?
2) What am I doing wrong with my rspec test? I tried numerous things but always get an error about 'new_resource' not being defined.


Failures:

  1) Chef::Provider::Service::Macosx loading Chef::Provider::Service::Macosx with HOME defined expands PLIST_DIRS with ~/Library/LaunchAgents
     Failure/Error: let(:provider) { described_class.new(new_resource, run_context) }
     NameError:
       undefined local variable or method `new_resource' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_3::Nested_1:0x1085f90c0>
     # ./spec/unit/provider/service/macosx_spec.rb:25
     # ./spec/unit/provider/service/macosx_spec.rb:30


Greetings,

Ringo



Archive powered by MHonArc 2.6.16.

§