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


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To: Ringo De Smet < >
  • Cc: Chef Dev < >
  • Subject: [chef-dev] Re: CHEF-3237: code review + help needed for rspec test
  • Date: Tue, 5 Feb 2013 11:30:19 -0500

I'm no Ruby expert, but you've gone and replaced the initialize method which is part of the default constructor? Won't that cause problems?

- Julian

On Tue, Feb 5, 2013 at 11:23 AM, Ringo De Smet < " target="_blank"> > wrote:
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



--
[ Julian C. Dunn < " target="_blank"> >          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ]
[ gopher://sdf.org/1/users/keymaker/           * compliant!    ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]


Archive powered by MHonArc 2.6.16.

§