diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 000000000..a59b1b14a --- /dev/null +++ b/.fixtures.yml @@ -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}" diff --git a/.gemfile b/.gemfile new file mode 100644 index 000000000..9aad840c0 --- /dev/null +++ b/.gemfile @@ -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' diff --git a/Rakefile b/Rakefile index 6242a3704..cd3d37995 100644 --- a/Rakefile +++ b/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' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 881ff9ff8..2c6f56649 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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'