-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1003 from soilSpoon/feature/brew
Update brew list command to remove deprecation warning
- Loading branch information
Showing
4 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,12 +34,12 @@ public function test_brew_can_be_resolved_from_container() | |
public function test_installed_returns_true_when_given_formula_is_installed() | ||
{ | ||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep [email protected]')->andReturn('[email protected]'); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep [email protected]')->andReturn('[email protected]'); | ||
swap(CommandLine::class, $cli); | ||
$this->assertTrue(resolve(Brew::class)->installed('[email protected]')); | ||
|
||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep php')->andReturn('php | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep php')->andReturn('php | ||
[email protected]'); | ||
swap(CommandLine::class, $cli); | ||
$this->assertTrue(resolve(Brew::class)->installed('php')); | ||
|
@@ -49,17 +49,17 @@ public function test_installed_returns_true_when_given_formula_is_installed() | |
public function test_installed_returns_false_when_given_formula_is_not_installed() | ||
{ | ||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep [email protected]')->andReturn(''); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep [email protected]')->andReturn(''); | ||
swap(CommandLine::class, $cli); | ||
$this->assertFalse(resolve(Brew::class)->installed('[email protected]')); | ||
|
||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep [email protected]')->andReturn('php'); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep [email protected]')->andReturn('php'); | ||
swap(CommandLine::class, $cli); | ||
$this->assertFalse(resolve(Brew::class)->installed('[email protected]')); | ||
|
||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep [email protected]')->andReturn('php | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep [email protected]')->andReturn('php | ||
[email protected] | ||
php7'); | ||
swap(CommandLine::class, $cli); | ||
|
@@ -211,7 +211,7 @@ public function test_tap_taps_the_given_homebrew_repository() | |
public function test_restart_restarts_the_service_using_homebrew_services() | ||
{ | ||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep dnsmasq')->andReturn('dnsmasq'); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep dnsmasq')->andReturn('dnsmasq'); | ||
$cli->shouldReceive('quietly')->once()->with('sudo brew services stop dnsmasq'); | ||
$cli->shouldReceive('quietly')->once()->with('sudo brew services start dnsmasq'); | ||
swap(CommandLine::class, $cli); | ||
|
@@ -222,7 +222,7 @@ public function test_restart_restarts_the_service_using_homebrew_services() | |
public function test_stop_stops_the_service_using_homebrew_services() | ||
{ | ||
$cli = Mockery::mock(CommandLine::class); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list | grep dnsmasq')->andReturn('dnsmasq'); | ||
$cli->shouldReceive('runAsUser')->once()->with('brew list --formula | grep dnsmasq')->andReturn('dnsmasq'); | ||
$cli->shouldReceive('quietly')->once()->with('sudo brew services stop dnsmasq'); | ||
swap(CommandLine::class, $cli); | ||
resolve(Brew::class)->stopService('dnsmasq'); | ||
|