File tree 7 files changed +17
-36
lines changed
7 files changed +17
-36
lines changed Original file line number Diff line number Diff line change 1
1
language : ruby
2
- gemfile :
3
- - test/support/Gemfile
4
2
rvm :
5
3
- 1.9.3
6
- script : BUNDLE_GEMFILE=test/support/Gemfile bundle exec rake test foodcritic
4
+ bundler_args : --without integration
Original file line number Diff line number Diff line change
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rake'
4
+ gem 'minitest'
5
+ gem 'foodcritic' , :platforms => :ruby_19
6
+
7
+ # allow CI to override the version of Chef for matrix testing
8
+ gem 'chef' , ( ENV [ 'CHEF_VERSION' ] || '>= 0.10.10' )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env rake
2
2
require 'rake/testtask'
3
+ require 'foodcritic'
3
4
4
5
Rake ::TestTask . new do |t |
5
- t . libs . push "lib"
6
- t . test_files = FileList [ 'test/**/*_spec.rb' ]
6
+ t . test_files = FileList [ 'test/unit/**/*_spec.rb' ]
7
7
t . verbose = true
8
8
end
9
9
10
- desc "Runs foodcritc linter"
11
- task :foodcritic do
12
- if Gem ::Version . new ( "1.9.2" ) <= Gem ::Version . new ( RUBY_VERSION . dup )
13
- sandbox = File . join ( File . dirname ( __FILE__ ) , %w{ tmp foodcritic cookbook } )
14
- prepare_foodcritic_sandbox ( sandbox )
15
-
16
- sh "foodcritic --epic-fail any #{ File . dirname ( sandbox ) } "
17
- else
18
- puts "WARN: foodcritic run is skipped as Ruby #{ RUBY_VERSION } is < 1.9.2."
19
- end
10
+ FoodCritic ::Rake ::LintTask . new do |t |
11
+ t . options = { :fail_tags => [ 'any' ] }
20
12
end
21
13
22
- task :default => 'test'
23
-
24
- private
25
-
26
- def prepare_foodcritic_sandbox ( sandbox )
27
- files = %w{ *.md *.rb attributes definitions files providers
28
- recipes resources templates }
29
-
30
- rm_rf sandbox
31
- mkdir_p sandbox
32
- cp_r Dir . glob ( "{#{ files . join ( ',' ) } }" ) , sandbox
33
- end
14
+ task :default => [ :foodcritic , :test ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 8
8
before do
9
9
@node = Chef ::Node . new
10
10
@node . consume_external_attrs ( ohai_data , { } )
11
- @node . from_file ( File . join ( File . dirname ( __FILE__ ) , %w{ .. .. attributes default.rb } ) )
11
+ @node . from_file ( File . join ( File . dirname ( __FILE__ ) , %w{ .. .. .. attributes default.rb } ) )
12
12
end
13
13
14
14
let ( :ohai_data ) do
Original file line number Diff line number Diff line change 1
1
require 'minitest/autorun'
2
- require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '../spec_helper' ) )
2
+ require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '../../ spec_helper' ) )
3
3
4
4
describe 'Chef::Provider::UserAccount' do
5
5
include ProviderMixins
Original file line number Diff line number Diff line change 1
1
require 'minitest/autorun'
2
- require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '../spec_helper' ) )
2
+ require File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '../../ spec_helper' ) )
3
3
4
4
describe 'Chef::Resource::UserAccount' do
5
5
include ResourceMixins
You can’t perform that action at this time.
0 commit comments