forked from voxpupuli/puppet-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for the new puppetlabs_spec_helper gem
* Add automatic fixtures creation to `rake spec` * Remove recursive symlink * Prepend fixtures modulepath instead of overriding * Update travis for the new automagical rake spec
- Loading branch information
Branan Purvine-Riley
committed
May 31, 2012
1 parent
02ceb1b
commit 2d0d759
Showing
7 changed files
with
14 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fixtures: | ||
repositories: | ||
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git" | ||
symlinks: | ||
"nodejs": "#{source_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source :rubygems | ||
|
||
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] | ||
gem 'puppet', puppetversion | ||
gem 'puppetlabs_spec_helper', '>= 0.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +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 | ||
# This requires pull request: https://github.com/rodjek/puppet-lint/pull/81 | ||
system("puppet-lint manifests") | ||
system("puppet-lint tests") | ||
end | ||
require 'puppetlabs_spec_helper/rake_tasks' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
require 'puppet' | ||
require 'mocha' | ||
require 'rspec' | ||
require 'rspec-puppet' | ||
require 'rspec/expectations' | ||
require 'puppetlabs_spec_helper' | ||
|
||
def param_value(subject, type, title, param) | ||
subject.resource(type, title).send(:parameters)[param.to_sym] | ||
end | ||
|
||
RSpec.configure do |c| | ||
c.module_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules')) | ||
# 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')) | ||
# | ||
c.mock_with :mocha | ||
end | ||
require 'puppetlabs_spec_helper/module_spec_helper' |