aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMike McQuaid2017-05-29 18:24:52 +0100
committerMike McQuaid2017-05-29 18:43:18 +0100
commit7a38bab333c6808022fe53aac2be9ca2e329cd53 (patch)
treebbc05eebc29bdb6d539cd0e9d197b3762b49ffce /Library/Homebrew/test
parent4356016b4a1c2eaba02680b4ad7f1747d2df53bf (diff)
downloadbrew-7a38bab333c6808022fe53aac2be9ca2e329cd53.tar.bz2
Fixup all RuboCop warnings.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/Gemfile4
-rw-r--r--Library/Homebrew/test/cask/download_strategy_spec.rb2
-rw-r--r--Library/Homebrew/test/formatter_spec.rb10
-rw-r--r--Library/Homebrew/test/formula_spec.rb2
-rw-r--r--Library/Homebrew/test/migrator_spec.rb4
-rw-r--r--Library/Homebrew/test/pathname_spec.rb2
-rw-r--r--Library/Homebrew/test/string_spec.rb14
7 files changed, 18 insertions, 20 deletions
diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile
index f3c16c710..dbe76b51c 100644
--- a/Library/Homebrew/test/Gemfile
+++ b/Library/Homebrew/test/Gemfile
@@ -2,11 +2,11 @@ source "https://rubygems.org"
gem "parallel_tests"
gem "rspec"
-gem "rubocop"
gem "rspec-its", require: false
gem "rspec-wait", require: false
+gem "rubocop"
group :coverage do
- gem "simplecov", require: false
gem "codecov", require: false
+ gem "simplecov", require: false
end
diff --git a/Library/Homebrew/test/cask/download_strategy_spec.rb b/Library/Homebrew/test/cask/download_strategy_spec.rb
index 91fe934be..27f1ad410 100644
--- a/Library/Homebrew/test/cask/download_strategy_spec.rb
+++ b/Library/Homebrew/test/cask/download_strategy_spec.rb
@@ -1,6 +1,6 @@
describe "download strategies", :cask do
let(:url) { "http://example.com/cask.dmg" }
- let(:url_options) { Hash.new }
+ let(:url_options) { {} }
let(:cask) {
instance_double(Hbc::Cask, token: "some-cask",
url: Hbc::URL.new(url, url_options),
diff --git a/Library/Homebrew/test/formatter_spec.rb b/Library/Homebrew/test/formatter_spec.rb
index 6357853d8..1a74e3405 100644
--- a/Library/Homebrew/test/formatter_spec.rb
+++ b/Library/Homebrew/test/formatter_spec.rb
@@ -4,11 +4,11 @@ require "utils/tty"
describe Formatter do
describe "::columns" do
let(:input) {
- [
- "aa",
- "bbb",
- "ccc",
- "dd",
+ %w[
+ aa
+ bbb
+ ccc
+ dd
]
}
subject { described_class.columns(input) }
diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb
index 5991e72d8..364dbfe98 100644
--- a/Library/Homebrew/test/formula_spec.rb
+++ b/Library/Homebrew/test/formula_spec.rb
@@ -683,7 +683,7 @@ describe Formula do
end
expect(f5.deps.map(&:name)).to eq(["f3", "f4"])
- expect(f5.recursive_dependencies.map(&:name)).to eq(["f1", "f2", "f3", "f4"])
+ expect(f5.recursive_dependencies.map(&:name)).to eq(%w[f1 f2 f3 f4])
expect(f5.runtime_dependencies.map(&:name)).to eq(["f1", "f4"])
end
diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb
index 90ee9d8ff..900c10c02 100644
--- a/Library/Homebrew/test/migrator_spec.rb
+++ b/Library/Homebrew/test/migrator_spec.rb
@@ -44,9 +44,7 @@ describe Migrator do
end
after(:each) do
- if !old_keg_record.parent.symlink? && old_keg_record.directory?
- keg.unlink
- end
+ keg.unlink if !old_keg_record.parent.symlink? && old_keg_record.directory?
if new_keg_record.directory?
new_keg = Keg.new(new_keg_record)
diff --git a/Library/Homebrew/test/pathname_spec.rb b/Library/Homebrew/test/pathname_spec.rb
index 77cb6cfed..0bc19c5ac 100644
--- a/Library/Homebrew/test/pathname_spec.rb
+++ b/Library/Homebrew/test/pathname_spec.rb
@@ -104,7 +104,7 @@ describe Pathname do
end
it "preserves permissions" do
- File.open(file, "w", 0100777).close
+ File.open(file, "w", 0100777) {}
file.atomic_write("CONTENT")
expect(file.stat.mode).to eq(0100777 & ~File.umask)
end
diff --git a/Library/Homebrew/test/string_spec.rb b/Library/Homebrew/test/string_spec.rb
index d1b820b66..ce26d70d4 100644
--- a/Library/Homebrew/test/string_spec.rb
+++ b/Library/Homebrew/test/string_spec.rb
@@ -3,19 +3,19 @@ require "extend/string"
describe String do
describe "#undent" do
it "removes leading whitespace, taking the first line as reference" do
- string = <<-EOS.undent
- hi
-........my friend over
- there
+ string = <<-EOS.unindent
+ hi
+ ........my friend over
+ there
EOS
expect(string).to eq("hi\n........my friend over\n there\n")
end
it "removes nothing if the text is not indented" do
- string = <<-EOS.undent
-hi
-I'm not indented
+ string = <<-EOS.unindent
+ hi
+ I'm not indented
EOS
expect(string).to eq("hi\nI'm not indented\n")