0

I have the following layout:

attributes/default.rb
recipes/my_recipe.rb
spec/unit/recipes/my_recipe_spec.rb

In the attributes files I have a lot of common settings likes

default['framework']['folder']['lib'] = '/usr/lib/fwrk'

I would like to use them in my chefspec, like

it 'install the lib if there are changes' do
    lib_path = chef_run.node['framework']['folder']['lib']
    puts(lib_path)
end

How can I include this file to my node from SoloRunner/ServerRunner?

mishka
  • 2,027
  • 2
  • 20
  • 30

1 Answers1

1

Run the .converge() first and you'll see them in there. But remember that you almost ever parameterize your tests on the same inputs on both sides, that wouldn't be a useful test since it doesn't check if the value is what you expected it to be.

coderanger
  • 52,400
  • 4
  • 52
  • 75