From a29737ac6de35488417c56a0548a64d076de9e62 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 30 Nov 2020 23:30:52 -0800 Subject: [PATCH 1/3] Test for `brew ruby -e 'puts "testball".f.path'` This test aims to prevent regressions of #9362. --- Library/Homebrew/test/dev-cmd/ruby_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb index ae13bf021f..fc7df22de6 100644 --- a/Library/Homebrew/test/dev-cmd/ruby_spec.rb +++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb @@ -15,3 +15,17 @@ describe "brew ruby", :integration_test do .and not_to_output.to_stderr end end + +describe "brew ruby -e 'puts \"testball\".f.path'", :integration_test do + let!(:target) do + target_path = setup_test_formula "testball" + { path: target_path } + end + + it "prints the path of a test formula" do + expect { brew "ruby", "-e", "puts 'testball'.f.path" } + .to be_a_success + .and output(/^#{target[:path]}$/).to_stdout + .and not_to_output.to_stderr + end +end From 7455d53f88cd8214266f638dee2f61baa830d367 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 3 Dec 2020 22:27:02 -0800 Subject: [PATCH 2/3] add :needs_linux to brew ruby test --- Library/Homebrew/test/dev-cmd/ruby_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb index fc7df22de6..ff96c16fad 100644 --- a/Library/Homebrew/test/dev-cmd/ruby_spec.rb +++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb @@ -16,7 +16,7 @@ describe "brew ruby", :integration_test do end end -describe "brew ruby -e 'puts \"testball\".f.path'", :integration_test do +describe "brew ruby -e 'puts \"testball\".f.path'", :integration_test, :needs_linux do let!(:target) do target_path = setup_test_formula "testball" { path: target_path } From f4e42191d069d053043446aafcb8899815a0a70b Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 4 Dec 2020 09:10:58 -0800 Subject: [PATCH 3/3] Add comment about :needs_linux Co-authored-by: Mike McQuaid --- Library/Homebrew/test/dev-cmd/ruby_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb index ff96c16fad..bac9e7dc29 100644 --- a/Library/Homebrew/test/dev-cmd/ruby_spec.rb +++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb @@ -16,6 +16,7 @@ describe "brew ruby", :integration_test do end end +# Doesn't actually need Linux but only running there as integration tests are slow. describe "brew ruby -e 'puts \"testball\".f.path'", :integration_test, :needs_linux do let!(:target) do target_path = setup_test_formula "testball"