Skip to content

Commit 56d6b94

Browse files
committed
Fix auto relationship spec tests for Windows
Use notify, an OS-neutral resource type, instead of File for the testing.
1 parent 65c4172 commit 56d6b94

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

spec/classes/relationships__type_with_auto_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
describe 'relationships::type_with_auto', :if => Puppet::Util::Package.versioncmp(Puppet.version, '4.0.0') >= 0 do
44
it { is_expected.to compile.with_all_deps }
55
it do
6-
is_expected.to contain_type_with_all_auto('/tmp')
7-
.that_comes_before('File[/tmp/before]')
8-
.that_notifies('File[/tmp/notify]')
9-
.that_requires('File[/tmp/require]')
10-
.that_subscribes_to('File[/tmp/subscribe]')
6+
is_expected.to contain_type_with_all_auto('test')
7+
.that_comes_before('Notify[test/before]')
8+
.that_notifies('Notify[test/notify]')
9+
.that_requires('Notify[test/require]')
10+
.that_subscribes_to('Notify[test/subscribe]')
1111
end
1212

13-
it { is_expected.to contain_file('/tmp/before').that_requires('Type_with_all_auto[/tmp]') }
14-
it { is_expected.to contain_file('/tmp/notify').that_subscribes_to('Type_with_all_auto[/tmp]') }
15-
it { is_expected.to contain_file('/tmp/require').that_comes_before('Type_with_all_auto[/tmp]') }
16-
it { is_expected.to contain_file('/tmp/subscribe').that_notifies('Type_with_all_auto[/tmp]') }
13+
it { is_expected.to contain_notify('test/before').that_requires('Type_with_all_auto[test]') }
14+
it { is_expected.to contain_notify('test/notify').that_subscribes_to('Type_with_all_auto[test]') }
15+
it { is_expected.to contain_notify('test/require').that_comes_before('Type_with_all_auto[test]') }
16+
it { is_expected.to contain_notify('test/subscribe').that_notifies('Type_with_all_auto[test]') }
1717
end
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Puppet::Type.newtype(:type_with_all_auto) do
22
ensurable
33
newparam(:name, :namevar => true)
4-
autobefore(:file) { [File.join(self[:name], 'before'), nil] }
5-
autonotify(:file) { [File.join(self[:name], 'notify'), nil] }
6-
autorequire(:file) { [File.join(self[:name], 'require'), nil] }
7-
autosubscribe(:file) { [File.join(self[:name], 'subscribe'), nil] }
4+
autobefore(:notify) { ["#{self[:name]}/before", nil] }
5+
autonotify(:notify) { ["#{self[:name]}/notify", nil] }
6+
autorequire(:notify) { ["#{self[:name]}/require", nil] }
7+
autosubscribe(:notify) { ["#{self[:name]}/subscribe", nil] }
88
end
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# This class is here to test type_with_all_auto which has alll auto* relations
22
class relationships::type_with_auto {
3-
type_with_all_auto { '/tmp':
3+
type_with_all_auto { 'test':
44
}
55

6-
file { ['/tmp/before', '/tmp/notify', '/tmp/require', '/tmp/subscribe']:
7-
ensure => file,
8-
}
6+
notify { ['test/before', 'test/notify', 'test/require', 'test/subscribe']: }
97
}

0 commit comments

Comments
 (0)