aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-11 12:08:13 +0200
committerRaphaël Pinson <raphael.pinson@camptocamp.com>2013-04-11 12:08:13 +0200
commitea4fd867017083119a41f3a35a4b8ed6ad9fdbdc (patch)
treeceaab5f2569538a85d2303be291d80f704b61e50
parent49e0718b41881715f03b139468a28a9aadff3c3e (diff)
downloadpuppet-dhcp-ea4fd867017083119a41f3a35a4b8ed6ad9fdbdc.tar.gz
puppet-dhcp-ea4fd867017083119a41f3a35a4b8ed6ad9fdbdc.tar.bz2
Prepare for rspec tests
-rw-r--r--.fixtures.yml6
-rw-r--r--.travis.yml15
-rw-r--r--Gemfile13
-rw-r--r--Rakefile5
-rw-r--r--spec/.rspec6
-rw-r--r--spec/fixtures/manifests/site.pp6
-rw-r--r--spec/spec_helper.rb4
7 files changed, 55 insertions, 0 deletions
diff --git a/.fixtures.yml b/.fixtures.yml
new file mode 100644
index 0000000..14caa2b
--- /dev/null
+++ b/.fixtures.yml
@@ -0,0 +1,6 @@
+fixtures:
+ repositories:
+ "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
+ "concat": "git://github.com/ripienaar/puppet-concat.git"
+ symlinks:
+ "dhcp": "#{source_dir}"
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6d7c0f8
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,15 @@
+language: ruby
+rvm:
+ - 1.8.7
+ - 1.9.3
+ - 2.0.0
+ - ruby-head
+env:
+ - PUPPET_GEM_VERSION=">= 3.0.0"
+matrix:
+ allow_failures:
+ - rvm: 2.0.0
+ - rvm: ruby-head
+ include:
+ - rvm: 1.8.7
+ env: PUPPET_GEM_VERSION="~> 2.7"
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..a500d9e
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,13 @@
+source :rubygems
+
+if ENV.key?('PUPPET_VERSION')
+ puppetversion = "= #{ENV['PUPPET_VERSION']}"
+else
+ puppetversion = ['>= 2.7']
+end
+
+gem 'rake'
+gem 'puppet-lint'
+gem 'rspec-puppet'
+gem 'puppet', puppetversion
+gem 'puppetlabs_spec_helper', '>= 0.4.0'
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..4d31fec
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,5 @@
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppetlabs_spec_helper/rake_tasks'
+
+task :default => [:spec, :lint]
+
diff --git a/spec/.rspec b/spec/.rspec
new file mode 100644
index 0000000..91cd642
--- /dev/null
+++ b/spec/.rspec
@@ -0,0 +1,6 @@
+--format
+s
+--colour
+--loadby
+mtime
+--backtrace
diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp
new file mode 100644
index 0000000..0380291
--- /dev/null
+++ b/spec/fixtures/manifests/site.pp
@@ -0,0 +1,6 @@
+# Fake $::concat_basedir fact
+$concat_basedir = '/var/lib/puppet/concat'
+
+# Default node to test defines
+node default {
+}
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..4edc964
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,4 @@
+require 'mocha'
+require 'rspec-puppet'
+require 'puppetlabs_spec_helper/module_spec_helper'
+