Permalink
Browse files

Switch to the puppetlabs_spec_helper gem

* Unified rake tasks with other modules
* Automatic generation of fixtures directory
  • Loading branch information...
1 parent 708568f commit dd0f233f8abb50e6d4ca4522df3e5d70cb5b6ab1 @branan branan committed Jun 1, 2012
Showing with 13 additions and 64 deletions.
  1. +11 −0 .fixtures.yml
  2. +0 −7 .travis.yml
  3. +1 −34 Rakefile
  4. +0 −1 spec/fixtures/modules/razor
  5. +1 −22 spec/spec_helper.rb
View
@@ -0,0 +1,11 @@
+fixtures:
+ repositories:
+ "apt": "git://github.com/puppetlabs/puppetlabs-apt.git"
+ "mongodb": "git://github.com/puppetlabs/puppetlabs-mongodb.git"
+ "nodejs": "git://github.com/puppetlabs/puppetlabs-nodejs.git"
+ "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
+ "sudo": "git://github.com/saz/puppet-sudo.git"
+ "tftp": "git://github.com/puppetlabs/puppetlabs-tftp.git"
+ "vcsrepo": "git://github.com/puppetlabs/puppetlabs-vcsrepo.git"
+ symlinks:
+ "razor": "#{source_dir}"
View
@@ -3,13 +3,6 @@ rvm:
- 1.8.7
- 1.9.3
before_script:
- - "git clone git://github.com/puppetlabs/puppetlabs-apt.git spec/fixtures/modules/apt"
- - "git clone git://github.com/puppetlabs/puppetlabs-mongodb.git spec/fixtures/modules/mongodb"
- - "git clone git://github.com/puppetlabs/puppetlabs-stdlib.git spec/fixtures/modules/stdlib"
- - "git clone git://github.com/puppetlabs/puppetlabs-nodejs.git spec/fixtures/modules/nodejs"
- - "git clone git://github.com/puppetlabs/puppetlabs-tftp.git spec/fixtures/modules/tftp"
- - "git clone git://github.com/puppetlabs/puppetlabs-vcsrepo.git spec/fixtures/modules/vcsrepo"
- - "git clone git://github.com/saz/puppet-sudo.git spec/fixtures/modules/sudo"
after_script:
script: "rake spec"
branches:
View
@@ -1,34 +1 @@
-require 'rubygems'
-require 'rake'
-require 'rspec/core/rake_task'
-
-task :default do
- system("rake -T")
-end
-
-task :specs => [:spec]
-
-desc "Run all rspec-puppet tests"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.rspec_opts = ['--color']
- # ignores fixtures directory.
- t.pattern = 'spec/{classes,defines,unit}/**/*_spec.rb'
-end
-
-desc "Build puppet module package"
-task :build do
- # This will be deprecated once puppet-module is a face.
- begin
- Gem::Specification.find_by_name('puppet-module')
- rescue Gem::LoadError, NoMethodError
- require 'puppet/face'
- pmod = Puppet::Face['module', :current]
- pmod.build('./')
- end
-end
-
-desc "Check puppet manifests with puppet-lint"
-task :lint do
- system("puppet-lint manifests")
- system("puppet-lint tests")
-end
+require 'puppetlabs_spec_helper/rake_tasks'
View
@@ -1,22 +1 @@
-require 'puppet'
-require 'mocha'
-require 'rspec'
-require 'rspec-puppet'
-
-def param_value(subject, type, title, param)
- subject.resource(type, title).send(:parameters)[param.to_sym]
-end
-
-Puppet.parse_config
-puppet_module_path = Puppet[:modulepath]
-fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
-
-RSpec.configure do |c|
- fixture_module_path = File.join(fixture_path, 'modules')
- c.module_path = [fixture_module_path, puppet_module_path].join(":")
- # Using an empty site.pp file to avoid: https://github.com/rodjek/rspec-puppet/issues/15
- c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests'))
- # Use fixtures for config file mainly to support using our own hiera.yaml settings.
- # Pending: https://github.com/rodjek/rspec-puppet/pull/21
- # c.config = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/puppet.conf'))
-end
+require 'puppetlabs_spec_helper/module_spec_helper'

0 comments on commit dd0f233

Please sign in to comment.