Skip to content

Commit

Permalink
Add testing files
Browse files Browse the repository at this point in the history
  • Loading branch information
CyBeRoni committed Mar 4, 2014
1 parent 2d3c573 commit 5ff3d28
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixtures:
repositories:
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib"
16 changes: 16 additions & 0 deletions .gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source 'https://rubygems.org'

gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false

if puppetversion = ENV['PUPPET_VERSION']
gem 'puppet', puppetversion, :require => false

if puppetversion[0].chr.to_i < 3
gem 'hiera-puppet', :require => false
end

else
gem 'puppet', :require => false
end

# vim:ft=ruby
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: ruby
rvm:
- 1.8.7
- 1.9.3
script: 'rake spec'
env:
- PUPPET_VERSION="~> 2.7.0"
- PUPPET_VERSION="3.3"
gemfile: .gemfile
branches:
only:
- master
notifications:
email: false
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'rake'
require 'puppetlabs_spec_helper/rake_tasks'
Empty file added manifests/site.pp
Empty file.
33 changes: 33 additions & 0 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'spec_helper'

describe 'ssh::client', :type => 'class' do
context "On Debian with no other parameters" do
let :facts do
{
:osfamily => 'Debian',
:interfaces => 'eth0',
:ipaddress_eth0 => '192.168.1.1'
}
end
it {
should contain_package('openssh-client').with(:ensure => 'present')
}
end
context "On Debian with custom ensure" do
let :facts do
{
:osfamily => 'Debian',
:interfaces => 'eth0',
:ipaddress_eth0 => '192.168.1.1'
}
end
let :params do
{
:ensure => 'latest'
}
end
it {
should contain_package('openssh-client').with(:ensure => 'latest')
}
end
end
33 changes: 33 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'spec_helper'

describe 'ssh::server', :type => 'class' do
context "On Debian with no other parameters" do
let :facts do
{
:osfamily => 'Debian',
:interfaces => 'eth0',
:ipaddress_eth0 => '192.168.1.1'
}
end
it {
should contain_package('openssh-server').with(:ensure => 'present')
}
end
context "On Debian with custom ensure" do
let :facts do
{
:osfamily => 'Debian',
:interfaces => 'eth0',
:ipaddress_eth0 => '192.168.1.1'
}
end
let :params do
{
:ensure => 'latest'
}
end
it {
should contain_package('openssh-server').with(:ensure => 'latest')
}
end
end
1 change: 1 addition & 0 deletions spec/fixtures/modules/ssh/files
1 change: 1 addition & 0 deletions spec/fixtures/modules/ssh/lib
1 change: 1 addition & 0 deletions spec/fixtures/modules/ssh/manifests
1 change: 1 addition & 0 deletions spec/fixtures/modules/ssh/templates
1 change: 1 addition & 0 deletions tests/server.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ssh::server

0 comments on commit 5ff3d28

Please sign in to comment.