commit
57ee2f6810
9
.travis.yml
Normal file
9
.travis.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
language: ruby
|
||||||
|
gemfile:
|
||||||
|
- test/support/Gemfile
|
||||||
|
rvm:
|
||||||
|
- 1.9.2
|
||||||
|
- 1.9.3
|
||||||
|
script:
|
||||||
|
- bundle exec rake knife
|
||||||
|
- bundle exec rake foodcritic
|
27
Rakefile
Normal file
27
Rakefile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env rake
|
||||||
|
|
||||||
|
require 'foodcritic'
|
||||||
|
|
||||||
|
task :default => [:foodcritic]
|
||||||
|
|
||||||
|
FoodCritic::Rake::LintTask.new
|
||||||
|
|
||||||
|
desc "Runs knife cookbook test"
|
||||||
|
task :knife do
|
||||||
|
Rake::Task[:prepare_sandbox].execute
|
||||||
|
|
||||||
|
sh "bundle exec knife cookbook test cookbook -c test/.chef/knife.rb -o #{sandbox_path}/../"
|
||||||
|
end
|
||||||
|
|
||||||
|
task :prepare_sandbox do
|
||||||
|
files = %w{*.md *.rb attributes definitions files libraries providers recipes resources templates}
|
||||||
|
|
||||||
|
rm_rf sandbox_path
|
||||||
|
mkdir_p sandbox_path
|
||||||
|
cp_r Dir.glob("{#{files.join(',')}}"), sandbox_path
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def sandbox_path
|
||||||
|
File.join(File.dirname(__FILE__), %w(tmp cookbooks cookbook))
|
||||||
|
end
|
2
test/.chef/knife.rb
Normal file
2
test/.chef/knife.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
cache_type 'BasicFile'
|
||||||
|
cache_options(:path => "#{ENV['HOME']}/.chef/checksums")
|
5
test/support/Gemfile
Normal file
5
test/support/Gemfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
gem 'rake'
|
||||||
|
gem 'foodcritic'
|
||||||
|
gem 'chef', '>= 10.12.0'
|
Loading…
x
Reference in New Issue
Block a user