Permalink
Browse files

Add integration tests for stock_system_and_user/system.

  • Loading branch information...
fnichol committed Dec 11, 2012
1 parent dcdcc93 commit 1685125e116e09bff762917f7249ad969bea9ccd
Showing with 45 additions and 0 deletions.
  1. +45 −0 test/integration/stock_system_and_user/bats/system.bats
@@ -0,0 +1,45 @@
+#!/usr/bin/env bats
+
+default_ruby="ruby-1.9.3-p194"
+https_url="https://google.com"
+
+setup() {
+ source /etc/profile.d/rvm.sh
+}
+
+@test "creates RVM directory" {
+ [ -d "/usr/local/rvm" ]
+}
+
+@test "sources into environment" {
+ [ "$(type rvm | head -1)" = "rvm is a function" ]
+}
+
+@test "installs $default_ruby" {
+ run rvm list strings
+ [ $status -eq 0 ]
+ [ $output = "$default_ruby" ]
+}
+
+@test "sets $default_ruby as the default" {
+ run 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 rvm $default_ruby do ruby -ropenssl -e "$expr"
+ [ $status -eq 0 ]
+}
+
+@test "default Ruby can install nokogiri gem" {
+ run 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 rvm $default_ruby do ruby -ropen-uri -rnokogiri -e "$expr"
+ [ $status -eq 0 ]
+}

0 comments on commit 1685125

Please sign in to comment.