2025-02-07 14:31:50 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "cmd/alias"
|
|
|
|
require "cmd/shared_examples/args_parse"
|
|
|
|
|
|
|
|
RSpec.describe Homebrew::Cmd::Alias do
|
|
|
|
it_behaves_like "parseable arguments"
|
|
|
|
|
|
|
|
it "sets an alias", :integration_test do
|
2025-07-11 13:05:44 -04:00
|
|
|
expect { brew "alias", "foo-test=bar" }
|
2025-02-07 14:31:50 +00:00
|
|
|
.to not_to_output.to_stdout
|
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
expect { brew "alias" }
|
2025-07-11 13:05:44 -04:00
|
|
|
.to output(/brew alias foo-test='bar'/).to_stdout
|
2025-02-07 14:31:50 +00:00
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
|
|
|
end
|