Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 20ac256

Browse files
authored
Merge pull request #1192 from Homebrew/brew_style_fix
`brew style --fix`
2 parents 66e44ea + 9ef2e1a commit 20ac256

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

spec/bundle/brew_dumper_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@
195195
it "returns an array for all formulae" do
196196
expect(Formula).to receive(:installed).and_return([foo, bar, baz])
197197
expect(bar.linked_keg).to receive(:realpath).and_return(OpenStruct.new(basename: "1.0"))
198-
expect(Tab).to receive(:for_keg).with(bar.linked_keg).and_return \
198+
expect(Tab).to receive(:for_keg).with(bar.linked_keg).and_return(
199199
instance_double(Tab,
200200
installed_as_dependency: false,
201201
installed_on_request: false,
202202
poured_from_bottle: true,
203203
runtime_dependencies: [],
204-
used_options: [])
204+
used_options: []),
205+
)
205206
expect(dumper.formulae_by_full_name).to eql({
206207
"bar" => bar_hash,
207208
"qux/quuz/foo" => foo_hash,

spec/bundle/cask_installer_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@
101101
end
102102

103103
it "installs cask with arguments" do
104-
expect(Bundle).to \
104+
expect(Bundle).to(
105105
receive(:system).with(HOMEBREW_BREW_FILE, "install", "--cask", "firefox", "--appdir=/Applications",
106106
verbose: false)
107-
.and_return(true)
107+
.and_return(true),
108+
)
108109
expect(described_class.preinstall("firefox", args: { appdir: "/Applications" })).to be(true)
109110
expect(described_class.install("firefox", args: { appdir: "/Applications" })).to be(true)
110111
end

spec/bundle/commands/check_command_spec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@
112112

113113
context "when restart_service is true" do
114114
it "raises an error" do
115-
allow_any_instance_of(Pathname).to \
116-
receive(:read).and_return("brew 'abc', restart_service: true\nbrew 'def', restart_service: true")
115+
allow_any_instance_of(Pathname).to(
116+
receive(:read).and_return("brew 'abc', restart_service: true\nbrew 'def', restart_service: true"),
117+
)
117118
allow_any_instance_of(Bundle::Checker::MacAppStoreChecker).to \
118119
receive(:format_checkable).and_return(1 => "foo")
119120
expect { do_check }.to raise_error(SystemExit).and output(expected_output).to_stdout
@@ -122,8 +123,9 @@
122123

123124
context "when start_service is true" do
124125
it "raises an error" do
125-
allow_any_instance_of(Pathname).to \
126-
receive(:read).and_return("brew 'abc', start_service: true\nbrew 'def', start_service: true")
126+
allow_any_instance_of(Pathname).to(
127+
receive(:read).and_return("brew 'abc', start_service: true\nbrew 'def', start_service: true"),
128+
)
127129
allow_any_instance_of(Bundle::Checker::MacAppStoreChecker).to \
128130
receive(:format_checkable).and_return(1 => "foo")
129131
expect { do_check }.to raise_error(SystemExit).and output(expected_output).to_stdout
@@ -149,8 +151,9 @@
149151
end
150152

151153
it "raises an error that doesn't mention upgrade" do
152-
allow_any_instance_of(Pathname).to \
153-
receive(:read).and_return("brew 'abc'")
154+
allow_any_instance_of(Pathname).to(
155+
receive(:read).and_return("brew 'abc'"),
156+
)
154157
allow_any_instance_of(Bundle::Checker::MacAppStoreChecker).to \
155158
receive(:format_checkable).and_return(1 => "foo")
156159
expect { do_check }.to raise_error(SystemExit).and output(expected_output).to_stdout

spec/bundle/commands/list_command_spec.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313

1414
describe "outputs dependencies to stdout" do
1515
before do
16-
allow_any_instance_of(Pathname).to receive(:read).and_return \
17-
"tap 'phinze/cask'\nbrew 'mysql', " \
18-
"conflicts_with: ['mysql56']\ncask 'google-chrome'\nmas '1Password', id: 443987910" \
19-
"\n whalebrew 'whalebrew/imagemagick'"
16+
allow_any_instance_of(Pathname).to receive(:read).and_return(
17+
<<~EOS,
18+
tap 'phinze/cask'
19+
brew 'mysql', conflicts_with: ['mysql56']
20+
cask 'google-chrome'
21+
mas '1Password', id: 443987910
22+
whalebrew 'whalebrew/imagemagick'
23+
EOS
24+
)
2025
end
2126

2227
it "only shows brew deps when no options are passed" do

spec/bundle/tap_dumper_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434
end
3535

3636
it "dumps output" do
37-
expect(dumper.dump).to eql \
37+
expect(dumper.dump).to eql(
3838
"tap \"bitbucket/bar\", \"https://bitbucket.org/bitbucket/bar.git\"\n" \
39-
"tap \"homebrew/baz\"\ntap \"homebrew/foo\""
39+
"tap \"homebrew/baz\"\ntap \"homebrew/foo\"",
40+
)
4041
end
4142
end
4243
end

0 commit comments

Comments
 (0)