Add integration tests for profiler

This commit is contained in:
apainintheneck 2022-12-30 10:50:35 -08:00
parent 5708ed3171
commit d318c56013
2 changed files with 21 additions and 0 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@
/Library/Homebrew/.npmignore
/Library/Homebrew/bin
/Library/Homebrew/doc
/Library/Homebrew/prof
/Library/Homebrew/test/.gem
/Library/Homebrew/test/.subversion
/Library/Homebrew/test/coverage

View File

@ -5,4 +5,24 @@ require "cmd/shared_examples/args_parse"
describe "brew prof" do
it_behaves_like "parseable arguments"
describe "integration tests", :integration_test do
after do
FileUtils.rm_rf HOMEBREW_LIBRARY_PATH/"prof"
end
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
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
end