-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source rbenv script before running command now works in conjunction w…
…ith the Bash resource. Remove toml generator
- Loading branch information
Showing
3 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,3 @@ | |
source 'https://rubygems.org' | ||
|
||
gem 'stove' | ||
gem 'community_cookbook_releaser' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters