Skip to content

Commit

Permalink
Merge pull request #36 from MosesMendoza/MODULES-3391/master/restrict…
Browse files Browse the repository at this point in the history
…_tests_on_older_puppet

(MODULES-3391) Limit `rake spec` on older puppet
  • Loading branch information
ferventcoder authored Jul 29, 2016
2 parents d3e1c25 + 4dab278 commit 59c5a43
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
require 'rake'
require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet'

begin
require 'beaker/tasks/test' unless RUBY_PLATFORM =~ /win32/
rescue LoadError
#Do nothing, only installed with system_tests group
end


# If puppet does not support symlinks (e.g., puppet <= 3.5) we cannot use
# puppetlabs_spec_helper's `rake spec` task because it requires symlink
# support. Redefine `rake spec` to avoid calling `rake spec_prep` (requires
# symlinks to place fixtures) and restrict the pattern match only files under
# the 'unit' directory (tests in other dirs require fixtures).
if Puppet::Util::Platform.windows? and !Puppet::FileSystem.respond_to?(:symlink)
ENV["SPEC"] = "./spec/{unit,integration}/**/*_spec.rb"
Rake::Task[:spec].clear if Rake::Task.task_defined?(:spec)
task :spec do
Rake::Task[:spec_standalone].invoke
Rake::Task[:spec_clean].invoke
end
end

# These lint exclusions are in puppetlabs_spec_helper but needs a version above 0.10.3
# Line length test is 80 chars in puppet-lint 1.1.0
PuppetLint.configuration.send('disable_80chars')
Expand Down

0 comments on commit 59c5a43

Please sign in to comment.