diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-30 20:39:34 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-09-06 15:44:40 -0500 |
commit | c5122b3002ecf2bcc77c2efcae75f288b44be261 (patch) | |
tree | 8fecb611aee682b58821a777092cf855525b2a89 | |
parent | c7a183c3b0397a16cc21661ffe924874f9b8bf0e (diff) | |
download | bundler-c5122b3002ecf2bcc77c2efcae75f288b44be261.tar.gz |
Warn in the quality spec when the exemption list is out of date
-rw-r--r-- | spec/quality_spec.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index 1a40769bac..7a34269831 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -172,7 +172,6 @@ RSpec.describe "The library itself" do auto_config_jobs cache_command_is_package console_command - default_cli_command deployment_means_frozen forget_cli_options gem.coc @@ -180,12 +179,11 @@ RSpec.describe "The library itself" do inline lockfile_uses_separate_rubygems_sources use_gem_version_promoter_for_major_updates - warned_version viz_command ] all_settings = Hash.new {|h, k| h[k] = [] } - documented_settings = exemptions + documented_settings = [] Bundler::Settings::BOOL_KEYS.each {|k| all_settings[k] << "in Bundler::Settings::BOOL_KEYS" } Bundler::Settings::NUMBER_KEYS.each {|k| all_settings[k] << "in Bundler::Settings::NUMBER_KEYS" } @@ -201,8 +199,14 @@ RSpec.describe "The library itself" do documented_settings = File.read("man/bundle-config.ronn")[/LIST OF AVAILABLE KEYS.*/m].scan(/^\* `#{key_pattern}`/).flatten end - documented_settings.each {|s| all_settings.delete(s) } - exemptions.each {|s| all_settings.delete(s) } + documented_settings.each do |s| + all_settings.delete(s) + expect(exemptions.delete(s)).to be_nil, "setting #{s} was exempted but was actually documented" + end + + exemptions.each do |s| + expect(all_settings.delete(s)).to be_truthy, "setting #{s} was exempted but unused" + end error_messages = all_settings.map do |setting, refs| "The `#{setting}` setting is undocumented\n\t- #{refs.join("\n\t- ")}\n" end |