Sha256: 5556acb09e092e0b3882a37df895e58f53e8a62e8eee6a09bea2d36ba7b014c6

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env bats

default_ruby="ruby-1.9.3-p484"
https_url="https://google.com"

setup() {
  source /etc/profile.d/rvm.sh
}

@test "creates system install RVM directory" {
  [ -d "/usr/local/rvm" ]
}

@test "sources into environment" {
  [ "$(type rvm | head -1)" = "rvm is a function" ]
}

@test "installs $default_ruby" {
  run sudo -u wigglebottom -i rvm list strings
  [ "$status" -eq 0 ]
  [ "$output" = "$default_ruby" ]
}

@test "sets $default_ruby as the default" {
  run sudo -u wigglebottom -i rvm list default string
  [ "$status" -eq 0 ]
  [ "${lines[0]}" = "$default_ruby" ]
}

@test "default Ruby can use openssl from stdlib" {
  expr="puts OpenSSL::PKey::RSA.new(32).to_pem"
  run sudo -u wigglebottom -i rvm $default_ruby do ruby -ropenssl -e "$expr"
  [ "$status" -eq 0 ]
}

@test "default Ruby can install nokogiri gem" {
  run sudo -u wigglebottom -i rvm $default_ruby do gem install nokogiri --no-ri --no-rdoc
  [ "$status" -eq 0 ]
}

@test "default Ruby can use nokogiri with openssl" {
  expr="puts Nokogiri::HTML(open('$https_url')).css('input')"
  run sudo -u wigglebottom -i rvm $default_ruby do ruby -ropen-uri -rnokogiri -e "$expr"
  [ "$status" -eq 0 ]
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
from-scratch-0.7.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.6.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.5.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.3.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.2.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.1.1 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats
from-scratch-0.1.0 cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats