Skip to content

Commit

Permalink
fixing rspec warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kreczko committed May 18, 2017
1 parent 22c25b8 commit a3e2a04
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 16 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
sudo: false
language: ruby
cache: bundler
bundler_args: --without development
script:
- puppet --version
- "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
matrix:
fast_finish: true
include:
- rvm: 1.9.3
- rvm: 2.1.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.6
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.1.7
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 4.0"
notifications:
email: false
23 changes: 21 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
source 'https://rubygems.org'

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
gem 'puppet', puppetversion
# Find a location or specific version for a gem. place_or_version can be a
# version, which is most often used. It can also be git, which is specified as
# `git://somewhere.git#branch`. You can also use a file source location, which
# is specified as `file://some/location/on/disk`.
def location_for(place_or_version, fake_version = nil)
if place_or_version =~ /^(git[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place_or_version =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place_or_version, { :require => false }]
end
end

supports_windows = false

gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
gem 'puppet-lint', '~> 2.0'
gem 'puppetlabs_spec_helper', '~> 2.1'
gem 'github_changelog_generator', '<= 1.14.3'
gem 'rspec-puppet', '~> 2.5'
gem 'rspec-puppet-facts'
gem 'rspec-puppet-utils'
gem 'metadata-json-lint'
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.send('disable_only_variable_string')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
PuppetLint.configuration.ignore_paths = ["spec/**/*", "pkg/**/*", 'vendor/**/*']
PuppetLint.configuration.exclude_paths = ["spec/**/*", "pkg/**/*", 'vendor/**/*']
6 changes: 4 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
hasrestart => true,
hasstatus => true,
}
->
#this exec is called from the config, but we can't run it if the condor service is not up. it's a RE-config command assuming something is already up.

# this exec is called from the config, but we can't run it if the condor
# service is not up. it's a RE-config command assuming something is already up.
exec{ '/usr/sbin/condor_reconfig':
refreshonly => true,
require => Service['condor']
}
}
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"dependencies": [
{
"name": "puppetlabs/firewall",
"version_requirement": "\u003e\u003d0.3.1"
"version_requirement": "~> 1.8"
},
{
"name": "puppetlabs/stdlib",
"version_requirement": "\u003e\u003d4.1.0"
"version_requirement": "~> 4.1"
}
],
"source": "git@github.com:HEP-Puppet/puppet-htcondor.git",
"project_page": "https://github.com/HEP-Puppet",
"license": "Apache License, Version 2.0"
"license": "Apache-2.0"
}
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-utils'
require 'rspec/mocks'
require 'rspec-puppet-facts'

# hack to enable all the expect syntax (like allow_any_instance_of) in rspec-puppet examples
RSpec::Mocks::Syntax.enable_expect(RSpec::Puppet::ManifestMatchers)

RSpec.configure do |c|
c.add_setting :puppet_future
c.puppet_future = Puppet.version.to_f >= 4.0
c.treat_symbols_as_metadata_keys_with_true_values = true

c.before :each do
# Ensure that we don't accidentally cache facts and environment
Expand Down

0 comments on commit a3e2a04

Please sign in to comment.