add lint rake task with robocop and fix issues

This commit is contained in:
Christoph Hartmann 2014-06-16 16:20:21 +02:00
parent ce048c7324
commit ae8d37b81d
7 changed files with 23 additions and 0 deletions

View file

@ -2,3 +2,4 @@ source 'https://rubygems.org'
gem 'rake'
gem 'serverspec'
gem 'rubocop', '~> 0.18.1'

View file

@ -1,6 +1,18 @@
require 'rake'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
# Rubocop
desc 'Run Rubocop lint checks'
task :rubocop do
Rubocop::RakeTask.new
end
# Lint the cookbook
desc "Run linters"
task :lint => [ :rubocop ]
# Serverspec tests
suites = Dir.glob('*').select{|entry| File.directory?(entry) }
class ServerspecTask < RSpec::Core::RakeTask

View file

@ -1,3 +1,5 @@
# encoding: utf-8
if ENV['STANDALONE_SPEC']
require 'serverspec'

View file

@ -1,3 +1,5 @@
# encoding: utf-8
require 'spec_helper'
RSpec.configure do |c|

View file

@ -1,3 +1,5 @@
# encoding: utf-8
require 'spec_helper'
describe 'preloaded modules' do

View file

@ -1,3 +1,5 @@
# encoding: utf-8
require 'serverspec'
require 'pathname'

View file

@ -1,3 +1,5 @@
# encoding: utf-8
require 'spec_helper'
describe 'System sysctl' do