diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-14 16:21:54 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:21:13 -0600 |
commit | e85b990916f16dd9a56dbafae6503f7a48d55131 (patch) | |
tree | f9244f2ab14db6abf5c0bc38ee5508ccfc94aa30 /spec/quality_spec.rb | |
parent | 9297bcf0135a0bd8c1df29b929267582ca66217d (diff) | |
download | bundler-e85b990916f16dd9a56dbafae6503f7a48d55131.tar.gz |
[RuboCop] Address Style/GuardClause
Diffstat (limited to 'spec/quality_spec.rb')
-rw-r--r-- | spec/quality_spec.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index bbe78a4079..4b7cdba1ff 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -13,9 +13,8 @@ describe "The library itself" do failing_lines << number + 1 if line =~ /^ *(describe|it|context) {1}'{1}/ end - unless failing_lines.empty? - "#{filename} uses inconsistent single quotes on lines #{failing_lines.join(", ")}" - end + return if failing_lines.empty? + "#{filename} uses inconsistent single quotes on lines #{failing_lines.join(", ")}" end def check_for_tab_characters(filename) @@ -24,9 +23,8 @@ describe "The library itself" do failing_lines << number + 1 if line =~ /\t/ end - unless failing_lines.empty? - "#{filename} has tab characters on lines #{failing_lines.join(", ")}" - end + return if failing_lines.empty? + "#{filename} has tab characters on lines #{failing_lines.join(", ")}" end def check_for_extra_spaces(filename) @@ -37,9 +35,8 @@ describe "The library itself" do failing_lines << number + 1 if line =~ /\s+\n$/ end - unless failing_lines.empty? - "#{filename} has spaces on the EOL on lines #{failing_lines.join(", ")}" - end + return if failing_lines.empty? + "#{filename} has spaces on the EOL on lines #{failing_lines.join(", ")}" end RSpec::Matchers.define :be_well_formed do |