diff options
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/quality_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb index 9db8baa4c0..ebe85d17d2 100644 --- a/spec/bundler/quality_spec.rb +++ b/spec/bundler/quality_spec.rb @@ -59,6 +59,18 @@ RSpec.describe "The library itself" do "#{filename} has spaces on the EOL on lines #{failing_lines.join(", ")}" end + def check_for_straneous_quotes(filename) + return if File.expand_path(filename) == __FILE__ + + failing_lines = [] + each_line(filename) do |line, number| + failing_lines << number + 1 if line =~ /’/ + end + + return if failing_lines.empty? + "#{filename} has an straneous quote on lines #{failing_lines.join(", ")}" + end + def check_for_expendable_words(filename) failing_line_message = [] useless_words = %w[ @@ -106,6 +118,19 @@ RSpec.describe "The library itself" do expect(error_messages.compact).to be_well_formed end + it "has no estraneous quotes" do + exempt = /vendor|vcr_cassettes|LICENSE|rbreadline\.diff/ + error_messages = [] + Dir.chdir(root) do + files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z` + files.split("\x0").each do |filename| + next if filename =~ exempt + error_messages << check_for_straneous_quotes(filename) + end + end + expect(error_messages.compact).to be_well_formed + end + it "does not include any leftover debugging or development mechanisms" do exempt = %r{quality_spec.rb|support/helpers|vcr_cassettes|\.md|\.ronn} error_messages = [] |