Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. require 'bundler'
  2. require 'rubocop/rake_task'
  3. require 'foodcritic'
  4. require 'rspec/core/rake_task'
  5. require 'stove/rake_task'
  6. require 'chef/knife'
  7.  
  8. desc 'Run all tests except Kitchen (default task)'
  9. task integration: %w(rubocop foodcritic spec)
  10. task default: :integration
  11.  
  12. desc 'Run linters'
  13. task lint: [:rubocop, :foodcritic]
  14.  
  15. desc 'Run all tests'
  16. task test: [:integration, :acceptance]
  17.  
  18. # ChefSpec
  19. desc 'Run ChefSpec tests'
  20. task :spec do
  21. puts 'Running chefspec tests...'
  22. RSpec::Core::RakeTask.new(:spec) do |t|
  23. t.rspec_opts = %w(--color)
  24. end
  25. end
  26.  
  27. # Foodcritic
  28. desc 'Run foodcritic lint checks'
  29. task :foodcritic do
  30. puts 'Running foodcritic...'
  31. FoodCritic::Rake::LintTask.new
  32. # puts 'Running Foodcritic tests...'
  33. # FoodCritic::Rake::LintTask.new do |t|
  34. # t.options = { fail_tags: ['any'] }
  35. # puts 'done.'
  36. # end
  37. end
  38.  
  39. # Rubocop
  40. desc 'Run Rubocop lint checks'
  41. task :rubocop do
  42. RuboCop::RakeTask.new
  43. end
  44.  
  45. # Test Kitchen
  46. begin
  47. require 'kitchen/rake_tasks'
  48. Kitchen::RakeTasks.new
  49.  
  50. desc 'Alias for kitchen:all'
  51. task acceptance: 'kitchen:all'
  52.  
  53. rescue LoadError
  54. puts '>>>>> Kitchen gem not loaded, omitting tasks' # unless ENV['CI']
  55. end
  56.  
  57. desc 'Release and Publish'
  58. task :release do
  59. if File.exist?("#{ENV['HOME']}/.stove")
  60. require 'stove/rake_task'
  61. Stove::RakeTask.new(:release)
  62. else
  63. puts "Please use 'stove login' before attempting to release."
  64. end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement