2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-27 11:49:56 +00:00
|
|
|
require "cmd/shared_examples/args_parse"
|
|
|
|
|
2024-02-18 15:11:11 -08:00
|
|
|
RSpec.describe "brew edit" do
|
2019-03-27 11:49:56 +00:00
|
|
|
it_behaves_like "parseable arguments"
|
|
|
|
|
2021-02-01 16:14:25 -05:00
|
|
|
it "opens a given Formula in an editor", :integration_test do
|
2017-02-23 06:00:54 +01:00
|
|
|
HOMEBREW_REPOSITORY.cd do
|
2017-07-29 19:55:05 +02:00
|
|
|
system "git", "init"
|
2017-02-23 06:00:54 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
setup_test_formula "testball"
|
|
|
|
|
2023-02-10 12:07:58 +01:00
|
|
|
expect { brew "edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat", "HOMEBREW_NO_ENV_HINTS" => "1" }
|
2017-02-23 06:00:54 +01:00
|
|
|
.to output(/# something here/).to_stdout
|
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
|
|
|
end
|