Permalink
Browse files

Migrate to spec helper.

  • Loading branch information...
1 parent 93b9544 commit f0a07a109167672603a41e34f90fb672f65b656b Nan Liu committed Aug 22, 2012
Showing with 24 additions and 130 deletions.
  1. +5 −0 .fixtures.yml
  2. +5 −0 .gemfile
  3. +5 −13 .travis.yml
  4. +0 −13 Gemfile
  5. +2 −2 Modulefile
  6. +4 −32 README.md
  7. +1 −53 Rakefile
  8. 0 spec/fixtures/manifests/site.pp
  9. +0 −1 spec/fixtures/modules/staging
  10. +2 −16 spec/spec_helper.rb
View
@@ -0,0 +1,5 @@
+fixtures:
+ repositories:
+ "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
+ symlinks:
+ "staging": "#{source_dir}"
View
@@ -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'
View
@@ -1,24 +1,16 @@
language: ruby
rvm:
- 1.8.7
- - 1.9.2
- - ree
before_script:
- - 'git clone git://github.com/puppetlabs/hiera-puppet.git spec/fixtures/modules/hiera-puppet'
- - 'mkdir /home/vagrant/.puppet'
- - 'cp spec/fixtures/hiera.yaml /home/vagrant/.puppet/hiera.yaml'
after_script:
- - 'rm /home/vagrant/.puppet/hiera.yaml'
- - 'rmdir /home/vagrant/.puppet'
script: "rake spec"
branches:
only:
- master
env:
- - PUPPET_VERSION=2.6.12
+ - PUPPET_VERSION=2.7.13
- PUPPET_VERSION=2.7.6
- - PUPPET_VERSION=2.7.9
-matrix:
- exclude:
- - rvm: 1.9.2
- env: PUPPET_VERSION=2.6.12
+ - PUPPET_VERSION=2.6.9
+notifications:
+ email: false
+gemfile: .gemfile
View
13 Gemfile
@@ -1,13 +0,0 @@
-source :rubygems
-
-puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
-
-gem 'puppet', puppetversion
-gem 'hiera', '>= 0.3.0'
-gem 'hiera-puppet', '>= 0.3.0'
-
-group :test do
- gem 'rake', '>= 0.9.0'
- gem 'rspec', '>= 2.8.0'
- gem 'rspec-puppet', '>= 0.1.1'
-end
View
@@ -1,7 +1,7 @@
name 'puppet-staging'
-version '0.1.0'
+version '0.2.0'
source 'git@github.com:nanliu/puppet-staging.git'
-author 'puppetlabs'
+author 'nanliu'
license 'Apache License Version 2.0'
summary 'File Staging'
description 'Manages file staging.'
View
@@ -1,9 +1,11 @@
-# puppet-staging
+# Staging module for Puppet
-Puppet management of staging directory, along with retrieval/extraction of staging files.
+Manages staging directory, along with download/extraction of compressed files.
[![Build Status](https://secure.travis-ci.org/nanliu/puppet-staging.png?branch=master)](http://travis-ci.org/nanliu/puppet-staging)
+WARNING: Version 0.2.0 no longer uses hiera functions. The same behavior should be available in Puppet 3.0.
+
## Usage
Specify a different default staging path (must be declared before using resource):
@@ -43,33 +45,3 @@ Staging files currently support the following source:
* puppet://
* ftp://
* local (though this doesn't serve any real purpose.)
-
-I'm considering support for additional protocols such as rsync and git.
-
-## Requirement
-
-This module no longer requires hiera on the puppet master.
-
- (no changes to puppet agent) with puppet backend and data as the datasource (default setting):
-
- ---
- :backend: - puppet
-
- :puppet:
- :datasource: data
-
-If you don't have hiera in your environment either module with the appropriate manifests will deploy hiera on the puppet master:
-
-* [puppet-hiera](https://github.com/nanliu/puppet-hiera)
-
- class { 'hiera':
- confdir => '/etc/puppet',
- modulepath => '/etc/puppet/modules',
- }
-
-* [puppetlabs-puppet](https://github.com/puppetlabs/puppetlabs-puppet)
-
- class { 'puppet::hiera':
- confdir => '/etc/puppet',
- modulepath => '/etc/puppet/modules',
- }
View
@@ -1,54 +1,2 @@
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
-
-desc "Testing in virtual system."
-task :vm do
- require 'vagrant'
- env = Vagrant::Environment.new
- puts "Bringing up vagrant environment"
- env.cli("up")
-end
-
-desc "Unit test in virtual system."
-task :vm_test do
- require 'facter'
- unless Facter.value('virtual')
- Dir.chdir('tests')
- Dir.glob('**/*.pp').each do |f|
- system("puppet apply -v #{f}")
- end
- end
-end
+require 'puppetlabs_spec_helper/rake_tasks'
No changes.
View
@@ -1,16 +1,2 @@
-require 'puppet'
-require 'rspec'
-require 'rspec-puppet'
-
-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'))
-end
+require 'rubygems'
+require 'puppetlabs_spec_helper/module_spec_helper'

0 comments on commit f0a07a1

Please sign in to comment.