From c0c02c20857b50e0d10a641e88cdddec17d23602 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 26 Aug 2014 15:30:57 +0200 Subject: [PATCH 1/2] feature: support newer robocop version Signed-off-by: Christoph Hartmann --- .rubocop.yml | 4 +++- Gemfile | 2 ++ Guardfile | 46 ++++++++++++++++++++++++---------------------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3b77f43..c18e892 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -17,8 +17,10 @@ HashSyntax: LineLength: Enabled: false MethodLength: - Max: 30 + Max: 40 NumericLiterals: MinDigits: 10 Style/CyclomaticComplexity: Max: 10 +Metrics/PerceivedComplexity: + Max: 10 diff --git a/Gemfile b/Gemfile index 5171673..e762172 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# encoding: utf-8 + source 'https://rubygems.org' gem 'berkshelf', '~> 3.0' diff --git a/Guardfile b/Guardfile index 925722e..fe71ed4 100644 --- a/Guardfile +++ b/Guardfile @@ -1,30 +1,32 @@ -# Guardfile +# encoding: utf-8 + +# Guardfile guard :rubocop do - watch(%r{.+\.rb$}) - watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } + watch(/.+\.rb$/) + watch(/(?:.+\/)?\.rubocop\.yml$/) { |m| File.dirname(m[0]) } end - -guard :foodcritic, cookbook_paths: '.', cli: "-f any --tags ~FC023" do - watch(%r{attributes/.+\.rb$}) - watch(%r{providers/.+\.rb$}) - watch(%r{recipes/.+\.rb$}) - watch(%r{resources/.+\.rb$}) - watch(%r{metadata.rb}) + +guard :foodcritic, cookbook_paths: '.', cli: '-f any --tags ~FC023' do + watch(/attributes\/.+\.rb$/) + watch(/providers\/.+\.rb$/) + watch(/recipes\/.+\.rb$/) + watch(/resources\/.+\.rb$/) + watch(/metadata.rb/) end - + guard :rspec do - watch(%r{^spec/.+_spec\.rb$}) - watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } + watch(/^spec\/.+_spec\.rb$/) + watch(/^(recipes)\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { 'spec' } end - + guard :kitchen, all_on_start: false do - watch(%r{test/.+}) - watch(%r{^recipes/(.+)\.rb$}) - watch(%r{^attributes/(.+)\.rb$}) - watch(%r{^files/(.+)}) - watch(%r{^templates/(.+)}) - watch(%r{^providers/(.+)\.rb}) - watch(%r{^resources/(.+)\.rb}) -end \ No newline at end of file + watch(/test\/.+/) + watch(/^recipes\/(.+)\.rb$/) + watch(/^attributes\/(.+)\.rb$/) + watch(/^files\/(.+)/) + watch(/^templates\/(.+)/) + watch(/^providers\/(.+)\.rb/) + watch(/^resources\/(.+)\.rb/) +end From 0962aaefdd356c69687ae51ea20ea52b26c6d9bc Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 26 Aug 2014 15:31:09 +0200 Subject: [PATCH 2/2] update readme with test instructions Signed-off-by: Christoph Hartmann --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7e1ef7c..e3cfc2c 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,17 @@ bundle install bundle exec rake lint # Fetch tests -thor kitchen:fetch-remote-tests +bundle exec thor kitchen:fetch-remote-tests -# Kitchen test -bundle exec kitchen list +# fast test on one machine bundle exec kitchen test default-ubuntu-1204 + +# test on all machines +bundle exec kitchen test + +# for development +bundle exec kitchen create default-ubuntu-1204 +bundle exec kitchen converge default-ubuntu-1204 ``` For more information see [test-kitchen](http://kitchen.ci/docs/getting-started)