Update module for the puppetlabs_spec_helper gem
* Load Rakefile and spec_helper from the common code in the gem * Add a .fixtures.yml for automatic creation of testing fixtures
This commit is contained in:
parent
90507334c8
commit
182959754a
8
.fixtures.yml
Normal file
8
.fixtures.yml
Normal file
@ -0,0 +1,8 @@
|
||||
fixtures:
|
||||
repositories:
|
||||
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git"
|
||||
"concat": "git://github.com/ripienaar/puppet-concat.git"
|
||||
"mysql": "git://github.com/puppetlabs/puppetlabs-mysql.git"
|
||||
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
|
||||
symlinks:
|
||||
"keystone": "#{source_dir}"
|
5
.gemfile
Normal file
5
.gemfile
Normal file
@ -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'
|
15
Rakefile
15
Rakefile
@ -1,14 +1 @@
|
||||
require 'rake'
|
||||
|
||||
task :default => [:spec]
|
||||
|
||||
desc "Run all module spec tests (Requires rspec-puppet gem)"
|
||||
task :spec do
|
||||
system("rspec spec/**/*_spec.rb")
|
||||
end
|
||||
|
||||
desc "Build package"
|
||||
task :build do
|
||||
system("puppet-module build")
|
||||
end
|
||||
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
|
@ -1,19 +1 @@
|
||||
require 'puppet'
|
||||
require 'rubygems'
|
||||
require 'rspec-puppet'
|
||||
require 'mocha'
|
||||
|
||||
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.mock_with :mocha
|
||||
c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests'))
|
||||
c.module_path = File.join(File.dirname(__FILE__), '../../')
|
||||
end
|
||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||
|
Loading…
Reference in New Issue
Block a user