Skip to content

Commit 0ea02e4

Browse files
committed
fixes special characters test to support windows file restrictions
1 parent 4a78188 commit 0ea02e4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

spec/acceptance/concat_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
end
151151
end
152152
context 'works when set to present with path that has special characters' do
153+
filename = fact('osfamily') == 'windows' ? 'file(1)' : 'file(1:2)'
154+
153155
before(:all) do
154156
pp = <<-EOS
155157
file { '#{basedir}':
@@ -159,21 +161,21 @@
159161
apply_manifest(pp)
160162
end
161163
pp="
162-
concat { 'file(a:b)':
164+
concat { '#{filename}':
163165
ensure => present,
164-
path => '#{basedir}/file(a:b)',
166+
path => '#{basedir}/#{filename}',
165167
mode => '0644',
166168
}
167169
concat::fragment { '1':
168-
target => 'file(a:b)',
170+
target => '#{filename}',
169171
content => '1',
170172
order => '01',
171173
}
172174
"
173175

174176
it_behaves_like 'successfully_applied', pp
175177

176-
describe file("#{basedir}/file(a:b)") do
178+
describe file("#{basedir}/#{filename}") do
177179
it { should be_file }
178180
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
179181
should be_mode 644

0 commit comments

Comments
 (0)