Merge pull request #1 from xaque208/tests

Begin module testing
This commit is contained in:
Zach Leslie 2015-05-18 22:20:56 -07:00
commit 160cfd501b
7 changed files with 136 additions and 0 deletions

3
.fixtures.yml Normal file
View File

@ -0,0 +1,3 @@
fixtures:
symlinks:
ldapquery: "#{source_dir}"

2
.rspec Normal file
View File

@ -0,0 +1,2 @@
--format documentation
--color

37
.travis.yml Normal file
View File

@ -0,0 +1,37 @@
---
language: ruby
bundler_args: --without development system_tests
before_install: rm Gemfile.lock || true
rvm:
- 1.9.3
- 2.0.0
- 2.1.0
script: bundle exec rake test
env:
- PUPPET_VERSION="~> 2.7.0"
- PUPPET_VERSION="~> 3.2.0"
- PUPPET_VERSION="~> 3.3.0"
- PUPPET_VERSION="~> 3.4.0"
- PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes
- PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes
- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes
- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes
matrix:
exclude:
# Ruby 1.9.3
- rvm: 1.9.3
env: PUPPET_VERSION="~> 2.7.0"
# Ruby 2.0.0
- rvm: 2.0.0
env: PUPPET_VERSION="~> 2.7.0"
# Ruby 2.1.0
- rvm: 2.1.0
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.2.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.3.0"
- rvm: 2.1.0
env: PUPPET_VERSION="~> 3.4.0"

24
Gemfile Normal file
View File

@ -0,0 +1,24 @@
source "https://rubygems.org"
group :test do
gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0'
gem "rspec", '< 3.2.0'
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
end
group :development do
gem "travis"
gem "travis-lint"
gem "vagrant-wrapper"
gem "puppet-blacksmith"
gem "guard-rake"
end
group :system_tests do
gem "beaker"
gem "beaker-rspec"
end

View File

@ -1,5 +1,7 @@
# Puppet-LDAPquery # Puppet-LDAPquery
[![Build Status](https://travis-ci.org/xaque208/puppet-ldapquery.svg?branch=master)](https://travis-ci.org/xaque208/puppet-ldapquery)
A Puppet function to query LDAP. A Puppet function to query LDAP.

56
Rakefile Normal file
View File

@ -0,0 +1,56 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet/version'
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
# These gems aren't always present, for instance
# on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end
Rake::Task[:lint].clear
PuppetLint.configuration.relative = true
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.fail_on_warnings = true
# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
exclude_paths = [
"bundle/**/*",
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
desc "Populate CONTRIBUTORS file"
task :contributors do
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
end
task :metadata do
sh "metadata-json-lint metadata.json"
end
desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
:metadata,
]

12
metadata.json Normal file
View File

@ -0,0 +1,12 @@
{
"name": "zleslie-ldapquery",
"version": "0.0.1",
"author": "Zach Leslie",
"summary": "Query an LDAP server using Puppet.",
"license": "Apache-2.0",
"source": "https://github.com/xaque208/puppet-ldapquery",
"project_page": "https://github.com/xaque208/puppet-ldapquery",
"issues_url": "https://github.com/xaque208/puppet-ldapquery/issues",
"dependencies": [ ]
}