Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/ruby: fix path to dev-cmd/irb and add test #3853

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module Homebrew
module_function

def ruby
exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rcmd/irb", *ARGV
exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rdev-cmd/irb", *ARGV
end
end
13 changes: 13 additions & 0 deletions Library/Homebrew/test/dev-cmd/ruby_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe "brew ruby", :integration_test do
it "executes ruby code with Homebrew's libraries loaded" do
expect { brew "ruby", "-e", "exit 0" }
.to be_a_success
.and not_to_output.to_stdout
.and not_to_output.to_stderr

expect { brew "ruby", "-e", "exit 1" }
.to be_a_failure
.and not_to_output.to_stdout
.and not_to_output.to_stderr
end
end