forked from acullenn/puppet-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfacts_test_spec.rb
More file actions
39 lines (34 loc) · 1.2 KB
/
facts_test_spec.rb
File metadata and controls
39 lines (34 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'spec_helper_acceptance'
describe 'python class' do
context 'facts' do
install_python = <<-EOS
class { 'python' :
pip => 'present',
}
EOS
fact_notices = <<-EOS
notify{"pip_version: ${facts['pip_version']}":}
notify{"system_python_version: ${facts['system_python_version']}":}
notify{"python_version: ${facts['python_version']}":}
EOS
# rubocop:disable RSpec/RepeatedExample
it 'outputs python facts when not installed' do
apply_manifest(fact_notices, catch_failures: true) do |r|
expect(r.stdout).to match(%r{python_version: \S+})
expect(r.stdout).to match(%r{pip_version: \S+})
expect(r.stdout).to match(%r{system_python_version: \S+})
end
end
it 'sets up python' do
apply_manifest(install_python, catch_failures: true)
end
it 'outputs python facts when installed' do
apply_manifest(fact_notices, catch_failures: true) do |r|
expect(r.stdout).to match(%r{python_version: \S+})
expect(r.stdout).to match(%r{pip_version: \S+})
expect(r.stdout).to match(%r{system_python_version: \S+})
end
end
# rubocop:enable RSpec/RepeatedExample
end
end