Permalink
Browse files

Add rspec skeleton, Gemfile, .travis.yml - no tests but rake works.

puppet-lint fixes
  • Loading branch information...
mkrakowitzer committed Mar 27, 2014
1 parent f514db2 commit cd0d9e079cc90b463bf735d6622121f55a6a69cd
View
@@ -0,0 +1,9 @@
+language: ruby
+rvm:
+# - 1.8.7
+ - 1.9.3
+script: "rake spec"
+env:
+ - PUPPET_VERSION=3.4.2
+notifications:
+ email: false
View
13 Gemfile
@@ -0,0 +1,13 @@
+source :rubygems
+
+if ENV.key?('PUPPET_VERSION')
+ puppetversion = "= #{ENV['PUPPET_VERSION']}"
+else
+ puppetversion = ['>= 2.7']
+end
+
+gem 'rake'
+gem 'puppet-lint'
+gem 'rspec-puppet'
+gem 'puppetlabs_spec_helper'
+gem 'puppet', puppetversion
View
@@ -0,0 +1,29 @@
+require 'rake'
+require 'rspec/core/rake_task'
+
+desc "Run all RSpec code examples"
+RSpec::Core::RakeTask.new(:rspec) do |t|
+ t.rspec_opts = File.read("spec/spec.opts").chomp || ""
+end
+
+SPEC_SUITES = (Dir.entries('spec') - ['.', '..','fixtures']).select {|e| File.directory? "spec/#{e}" }
+namespace :rspec do
+ SPEC_SUITES.each do |suite|
+ desc "Run #{suite} RSpec code examples"
+ RSpec::Core::RakeTask.new(suite) do |t|
+ t.pattern = "spec/#{suite}/**/*_spec.rb"
+ t.rspec_opts = File.read("spec/spec.opts").chomp || ""
+ end
+ end
+end
+task :default => :rspec
+
+begin
+ if Gem::Specification::find_by_name('puppet-lint')
+ require 'puppet-lint/tasks/puppet-lint'
+ PuppetLint.configuration.send('disable_80chars')
+ PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
+ task :default => [:rspec, :lint]
+ end
+rescue Gem::LoadError
+end
View
@@ -1,4 +1,4 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Copyright (c) 2012 Bryce Johnson
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
class jira::config {
require jira
@@ -56,7 +56,7 @@
}
file { "${jira::webappdir}/conf/server.xml":
- content => template("jira/server.xml.erb"),
+ content => template('jira/server.xml.erb'),
mode => '0600',
require => Class['jira::install'],
notify => Class['jira::service'],
View
@@ -1,4 +1,4 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Copyright (c) 2012 Bryce Johnson
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# == Class: jira
#
# This module is used to install Jira.
@@ -108,7 +108,7 @@
) {
if $jira::db != 'postgresql' and $jira::db != 'mysql' {
- fail("jira db parameter must be postgresql or mysql")
+ fail('jira db parameter must be postgresql or mysql')
}
$webappdir = "${installdir}/atlassian-${product}-${version}-standalone"
View
@@ -1,4 +1,4 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Copyright (c) 2012 Bryce Johnson
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
class jira::install {
require jira
No changes.
View
No changes.
View
@@ -0,0 +1,8 @@
+require 'rspec-puppet'
+
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
+
+RSpec.configure do |c|
+ c.module_path = File.join(fixture_path, 'modules')
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+end

0 comments on commit cd0d9e0

Please sign in to comment.