Skip to content

Commit 82c18a0

Browse files
authored
Merge pull request #135 from Iristyle/maint/stable/PUP-4.6-fixes-transaction-persistence
(maint) Fix test failures for Puppet 4.6
2 parents df66ecd + 7ae8cc6 commit 82c18a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/unit/provider/exec/powershell_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'spec_helper'
33
require 'puppet/util'
44
require 'puppet_x/puppetlabs/powershell/powershell_manager'
5+
require 'fileutils'
56

67
describe Puppet::Type.type(:exec).provider(:powershell) do
78

@@ -115,6 +116,19 @@
115116
}
116117
MANIFEST
117118
}
119+
let(:tmpdir) { Dir.mktmpdir('statetmp').encode!(Encoding::UTF_8) }
120+
121+
before :each do
122+
# a statedir setting must now exist per the new transactionstore code
123+
# introduced in Puppet 4.6 for corrective changes, as a new YAML file
124+
# called transactionstore.yaml will be written under this path
125+
# which defaults to c:\dev\null when not set on Windows
126+
Puppet[:statedir] = tmpdir
127+
end
128+
129+
after :each do
130+
FileUtils.rm_rf(tmpdir)
131+
end
118132

119133
def compile_to_catalog(string, node = Puppet::Node.new('foonode'))
120134
Puppet[:code] = string

0 commit comments

Comments
 (0)