Skip to content

Commit

Permalink
Source rbenv script before running command now works in conjunction w…
Browse files Browse the repository at this point in the history
…ith the Bash

resource.
Remove toml generator
  • Loading branch information
damacus committed Jun 27, 2017
1 parent 1c6836b commit 217657b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
source 'https://rubygems.org'

gem 'stove'
gem 'community_cookbook_releaser'
12 changes: 6 additions & 6 deletions test/integration/system_ruby/controls/global_ruby.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# frozen_string_literal: true
global_ruby = '2.1.6'
https_url = 'https://google.com'

expr_1 = 'puts OpenSSL::PKey::RSA.new(32).to_pem'
expr_2 = "puts Nokogiri::HTML(open('$https_url')).css('input')"
expr_2 = "puts Nokogiri::HTML(open('https://google.com')).css('input')"

control 'Global Ruby' do
title 'Should install Ruby globally'

desc "can set global Ruby version to #{global_ruby}"
describe command('source /etc/profile.d/rbenv.sh') do
describe bash('source /etc/profile.d/rbenv.sh && rbenv versions --bare') do
its('exit_status') { should eq 0 }
its('stdout') { should match /#{Regexp.quote(global_ruby)}/ }
end

desc 'can use openssl from stdlib'
describe command("ruby -ropenssl -e #{expr_1}") do
describe bash("source /etc/profile.d/rbenv.sh && ruby -ropenssl -e #{expr_1}") do
its('exit_status') { should eq 0 }
end

desc 'can install nokogiri gem'
describe command('gem install nokogiri --no-ri --no-rdoc') do
describe bash('source /etc/profile.d/rbenv.sh && gem install nokogiri --no-ri --no-rdoc') do
its('exit_status') { should eq 0 }
end

desc 'can use Nokogiri with OpenSSL'
describe command("ruby -ropen-uri -rnokogiri -e #{expr_2}") do
describe bash("source /etc/profile.d/rbenv.sh && ruby -ropen-uri -rnokogiri -e #{expr_2}") do
its('exit_status') { should eq 0 }
end
end
4 changes: 1 addition & 3 deletions test/integration/system_ruby/controls/installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
it { should be_directory}
end

# desc 'loads environment'
# describe
desc 'rbenv is a function'
describe command('type rbenv') do
describe bash('source /etc/profile.d/rbenv.sh && type rbenv') do
its('exit_status') { should eq 0 }
its('stdout') { should match /rbenv is a function/ }
end
Expand Down

0 comments on commit 217657b

Please sign in to comment.