Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #633 from Foodcritic/fc088
Browse files Browse the repository at this point in the history
Don't detect Chef::Mixin::ShellOut as being Chef::ShellOut
  • Loading branch information
tas50 committed May 19, 2017
2 parents 8c492a7 + b9214db commit d7d0ee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/foodcritic/rules/fc089.rb
Expand Up @@ -2,7 +2,7 @@
tags %w{chef13 deprecated}

def old_shellout(ast)
ast.xpath('//const[@value="ShellOut"]/..//const[@value="Chef"]')
ast.xpath('//const_path_ref[var_ref/const[@value="Chef"]]/const[@value="ShellOut"]')
end

resource { |ast| old_shellout(ast) }
Expand Down
5 changes: 5 additions & 0 deletions spec/functional/fc089_spec.rb
Expand Up @@ -15,4 +15,9 @@
resource_file "include Mixlib::Shellout"
it { is_expected.not_to violate_rule }
end

context "with a cookbook with a resource that uses Chef::Mixin::ShellOut" do
resource_file "include Chef::Mixin::ShellOut"
it { is_expected.not_to violate_rule }
end
end

0 comments on commit d7d0ee7

Please sign in to comment.