Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1de8761

Browse files
committedFeb 10, 2015
basic tests
1 parent 9cd7aad commit 1de8761

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
 

‎.fixtures.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fixtures:
2+
repositories:
3+
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
4+
symlinks:
5+
mongodb: "#{source_dir}"

‎Gemfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source 'https://rubygems.org'
2+
3+
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
4+
gem 'puppet', puppetversion
5+
gem 'puppetlabs_spec_helper', '>= 0.1.0'
6+
gem 'puppet-lint', '>= 0.3.2'
7+
gem 'facter', '>= 1.7.0'

‎spec/classes/redis_install_spec.rb

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
3+
describe 'redis::install' do
4+
5+
context 'Unsupported OS' do
6+
let(:facts) {{ :osfamily => 'unsupported' }}
7+
it { expect { should contain_class('redis::install')}.to raise_error(Puppet::Error, /The module does not support this OS/ )}
8+
end
9+
10+
context 'with defaults for all parameters on RedHat' do
11+
let(:facts) {{ :osfamily => 'RedHat' }}
12+
it { should contain_class('redis::installbinary') }
13+
end
14+
15+
context 'with defaults for all parameters on Debian' do
16+
let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'ubuntu' }}
17+
it { should contain_class('redis::installbinary') }
18+
end
19+
20+
end

‎spec/spec_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'puppetlabs_spec_helper/module_spec_helper'

0 commit comments

Comments
 (0)