Skip to content

Code to set the PATH in install-msi.rb causes chefspec to fail on non-Windows platforms #35

@mattstratton

Description

@mattstratton

Cookbook version

4.2.0

Platform Details

MacOS
ChefDK 1.2.22

Scenario:

Attempting to include the default recipe from this cookbook in another cookbook, and then run default chefspec tests on that cookbook.

Steps to Reproduce:

  1. create new cookbook with chef generate cookbook
  2. depend on webpi.
  3. add include_recipe 'webpi::install-msi' to default.rb.
  4. run standard chefspec test.

Expected Result:

I expect no errors from chefspec

Actual Result:

[2017-04-24T18:31:10-05:00] ERROR: Unable to find Webpi executable
F

Failures:

  1) pi_test::default converges successfully
     Failure/Error: expect { chef_run }.to_not raise_error

       expected no Exception, got #<RuntimeError: WebpiCmd.exe can't be found> with backtrace:
         # /var/folders/v1/dp0988lj1tv15nmv63fby85c0000gn/T/d20170424-29440-1taq1qa/cookbooks/webpi/recipes/install-msi.rb:38:in `from_file'
         # /var/folders/v1/dp0988lj1tv15nmv63fby85c0000gn/T/d20170424-29440-1taq1qa/cookbooks/pi_test/recipes/default.rb:7:in `from_file'
         # ./spec/unit/recipes/default_spec.rb:23:in `block (2 levels) in <top (required)>'
         # ./spec/unit/recipes/default_spec.rb:26:in `block (3 levels) in <top (required)>'
         # ./spec/unit/recipes/default_spec.rb:26:in `block (2 levels) in <top (required)>'
     # ./spec/unit/recipes/default_spec.rb:26:in `block (2 levels) in <top (required)>'

Finished in 0.35951 seconds (files took 3.03 seconds to load)
1 example, 1 failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedAssistance is required to resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions