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

Run rvm use when sw_vers is available #853

Merged
merged 4 commits into from Oct 5, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/travis/build/appliances.rb
Expand Up @@ -16,6 +16,7 @@
require 'travis/build/appliances/fix_resolv_conf'
require 'travis/build/appliances/home_paths'
require 'travis/build/appliances/put_localhost_first'
require 'travis/build/appliances/rvm_use'
require 'travis/build/appliances/services'
require 'travis/build/appliances/show_system_info'
require 'travis/build/appliances/validate'
Expand Down
15 changes: 15 additions & 0 deletions lib/travis/build/appliances/rvm_use.rb
@@ -0,0 +1,15 @@
require 'travis/build/appliances/base'

module Travis
module Build
module Appliances
class RvmUse < Base
def apply
sh.if "$(command -v sw_vers)" do
sh.cmd "rvm use", echo: true
end
end
end
end
end
end
1 change: 1 addition & 0 deletions lib/travis/build/script.rb
Expand Up @@ -157,6 +157,7 @@ def configure
apply :disable_ssh_roaming
apply :debug_tools
apply :npm_registry
apply :rvm_use
end

def checkout
Expand Down
6 changes: 6 additions & 0 deletions spec/build/script/shared/appliances/rvm_use.rb
@@ -0,0 +1,6 @@
shared_examples_for 'rvm use' do
let(:sexp) { sexp_filter(subject, [:if, '$(command -v sw_vers)']) }
it 'runs "rvm use"' do
expect(sexp).to include_sexp [:cmd, "rvm use", echo: true]
end
end
1 change: 1 addition & 0 deletions spec/build/script/shared/script.rb
Expand Up @@ -56,6 +56,7 @@
it_behaves_like 'build script stages'
it_behaves_like 'npm registry override'
it_behaves_like 'update libc6'
it_behaves_like 'rvm use'

it 'calls travis_result' do
should include_sexp [:raw, 'travis_result $?']
Expand Down