2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-03-08 13:35:56 -08:00
|
|
|
require "cmd/shared_examples/args_parse"
|
2024-03-04 10:29:47 -08:00
|
|
|
require "dev-cmd/prof"
|
2022-12-30 10:50:35 -08:00
|
|
|
|
2024-03-04 10:29:47 -08:00
|
|
|
RSpec.describe Homebrew::DevCmd::Prof do
|
2024-04-02 11:43:41 -07:00
|
|
|
it_behaves_like "parseable arguments"
|
2024-03-08 13:35:56 -08:00
|
|
|
|
2023-02-17 15:26:18 +00:00
|
|
|
describe "integration tests", :integration_test, :needs_network do
|
|
|
|
after do
|
|
|
|
FileUtils.rm_rf HOMEBREW_LIBRARY_PATH/"prof"
|
|
|
|
end
|
2022-12-30 10:50:35 -08:00
|
|
|
|
2023-02-17 15:26:18 +00:00
|
|
|
it "works using ruby-prof (the default)" do
|
|
|
|
expect { brew "prof", "help", "HOMEBREW_BROWSER" => "echo" }
|
|
|
|
.to output(/^Example usage:/).to_stdout
|
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
2022-12-30 10:50:35 -08:00
|
|
|
|
2023-02-17 15:26:18 +00:00
|
|
|
it "works using stackprof" do
|
|
|
|
expect { brew "prof", "--stackprof", "help", "HOMEBREW_BROWSER" => "echo" }
|
|
|
|
.to output(/^Example usage:/).to_stdout
|
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
|
|
|
end
|
2019-03-27 14:22:30 +00:00
|
|
|
end
|