Skip to content

Commit 02cdbd2

Browse files
committed
add more unit tests
1 parent fa7de2b commit 02cdbd2

File tree

5 files changed

+68
-2
lines changed

5 files changed

+68
-2
lines changed

.gitignore

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/pkg/
7+
/spec/reports/
8+
/test/tmp/
9+
/test/version_tmp/
10+
/tmp/
11+
12+
# Beaker/Vagrant
13+
.vagrant/
14+
15+
# Puppet Files
16+
pkg
17+
spec/fixtures
18+
.rspec_system
19+
.vagrant/
20+
21+
## Specific to RubyMotion:
22+
.dat*
23+
.repl_history
24+
build/
25+
26+
## Documentation cache and generated files:
27+
/.yardoc/
28+
/_yardoc/
29+
/doc/
30+
/rdoc/
31+
32+
## Environment normalisation:
33+
/.bundle/
34+
/lib/bundler/man/
35+
36+
Gemfile.lock
37+
.ruby-version
38+
.ruby-gemset
39+
40+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
41+
.rvmrc
42+
43+
# idea
44+
./idea
45+
.idea/
46+
47+
# geppetto/eclipse
48+
.project
49+
50+
# others
51+
*swp
52+
.DS_Store

Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ def location_for(place, version = nil)
1111
end
1212

1313
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || '~> 4')
14-
gem 'facter', '>= 2.0'
14+
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION'] || '~> 2')
1515
gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false
1616
gem 'puppet-lint', '>= 0.3.2', :require => false
1717
gem 'rspec-puppet', '>= 2.3.2', :require => false
18+
gem 'rspec-puppet-facts', :require => false
1819
gem 'metadata-json-lint', :require => false
1920
gem 'rake', '< 11.0.0' # rubi <1.9 versus rake 11.0.0 workaround
2021

manifests/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
ensure_packages('build-essential')
6868
Package['build-essential'] -> Anchor['redis::prepare_build']
6969
}
70-
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific': {
70+
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific', 'Sles': {
7171
ensure_packages('make')
7272
Package['make'] -> Anchor['redis::prepare_build']
7373
ensure_packages('gcc')

spec/classes/install_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,15 @@
2727
end
2828
end
2929

30+
on_supported_os.each do |os, facts|
31+
context "on #{os}" do
32+
let(:facts) do
33+
facts
34+
end
35+
36+
it { is_expected.to compile.with_all_deps }
37+
38+
end
39+
end
40+
3041
end

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
end
88

99
require 'puppetlabs_spec_helper/module_spec_helper'
10+
require 'rspec-puppet-facts'
11+
include RspecPuppetFacts

0 commit comments

Comments
 (0)