0

I'm building an acceptance test for puppet on windows where I need to make sure certain security policies where indeed changed after the manifest is applied. I have

it 'should modify security policy' do
     system("secedit.exe /export /areas SECURITYPOLICY /cfg C:\policy.txt")
     File.read('C:\policy.txt').should include "Banner Title"
end

When I run this I get a no such file or directory in reference to the file I'm creating, this leads me to believe the initial command pulling the policies into a file isn't being run.

Is there something I'm doing wrong?

2 Answers2

0

Rspec is probably not looking in the directories that you are needing it to look at. You probably need a line similar to the following into your rails_helper.rb or spec_helper.rb file:

Dir[Rails.root.join('app/policies/**/*.rb')].each { |f| require f }
Ginnie Hench
  • 277
  • 2
  • 11
0

Turns out the issue is the system function would run whatever command I specify locally on the host machine but the VM I was trying to run the puppet environment in. Ended up using the on(server, 'COMMAND') function instead.