forked from cblument/puppetlabs-nova
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use puppetlabs_spec_helper gem
* Automatically populate fixtures directory on spec runs * Avoid duplicating spec_helper and Rakefile between modules * Prepend fixtures to modulepath instead of overriding * Remove recursive symlink in fixtures dir
- Loading branch information
Branan Purvine-Riley
committed
Jun 1, 2012
1 parent
bfc6f89
commit afba13e
Showing
5 changed files
with
16 additions
and
33 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,9 @@ | ||
fixtures: | ||
repositories: | ||
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git" | ||
"keystone": "git://github.com/puppetlabs/puppetlabs-keystone.git" | ||
"mysql": "git://github.com/puppetlabs/puppetlabs-mysql.git" | ||
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
"sysctl": "git://github.com/duritong/puppet-sysctl.git" | ||
symlinks: | ||
"nova": "#{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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1 @@ | ||
require 'rake' | ||
require 'rubygems' | ||
require 'rspec/core/rake_task' | ||
|
||
task :default => [:spec] | ||
|
||
desc "Run all module spec tests (Requires rspec-puppet gem)" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
desc "Build package" | ||
task :build do | ||
system("puppet-module build") | ||
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,18 +1 @@ | ||
require 'puppet' | ||
require 'rspec' | ||
require 'rspec-puppet' | ||
|
||
def param_value(subject, type, title, param) | ||
subject.resource(type, title).send(:parameters)[param.to_sym] | ||
end | ||
|
||
def verify_contents(subject, title, expected_lines) | ||
content = subject.resource('file', title).send(:parameters)[:content] | ||
(content.split("\n") & expected_lines).should == expected_lines | ||
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')) | ||
end | ||
require 'puppetlabs_spec_helper/module_spec_helper' |