0
私はシェフには比較的新しく、ChefSpecには新しくありません。私はどのようにわからないChefSpecの適用プラットフォームとバージョンについてのシェフ警告
WARNING: you must specify a 'platform' and 'version' to your ChefSpec
Runner and/or Fauxhai constructor, in the future omitting these will
become a hard error. A list of available platforms is available at
https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
.WARNING: you must specify a 'platform' and 'version' to your ChefSpec
Runner and/or Fauxhai constructor, in the future omitting these will
become a hard error. A list of available platforms is available at
https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
:
require 'chefspec'
require 'chefspec/berkshelf'
ChefSpec::Coverage.start! do
add_output do |reportOutput|
File.open("coverage.json","w") do |f|
f.puts(reportOutput[:total])
f.puts(reportOutput[:touched])
f.puts(reportOutput[:coverage])
f.puts(reportOutput[:untouched_resources])
f.puts(reportOutput[:all_resources])
end
end
end
私はrspec
を実行すると、私は出力にこれを取得:私は以下のspec_helper.rb
ファイルを使用してChefSpecカバレッジを取得するためにCoverage
を実行しようとしていますCoverage
にプラットフォームとバージョンを指定してください - ChefSpec::ServerRunner.new()
で行う方法の例を見ました。