Permalink
Browse files

Add unit tests for installer flags & integration tests for convergence.

  • Loading branch information...
1 parent c592584 commit 88ee8bb8b83f986192d13e9837e2d63e7b7c3317 @fnichol fnichol committed Jan 25, 2013
View
@@ -55,3 +55,17 @@ suites:
attributes:
rvm:
default_ruby: rbx
+- name: rvm_versions
+ run_list:
+ - recipe[user::data_bag]
+ - recipe[rvm::user_install]
+ attributes:
+ users:
+ - virgil1
+ - virgil2
+ rvm:
+ user_installs:
+ - user: virgil1
+ version: 1.17.10
+ - user: virgil2
+ version: 1.16.20
View
@@ -1,18 +1,25 @@
#!/usr/bin/env rake
require 'foodcritic'
+require 'rake/testtask'
# FC041 is excluded because we want to preserve the official RVM installation
# process as much as possible, i.e. using curl to download the installer.
FoodCritic::Rake::LintTask.new do |t|
t.options = { :fail_tags => ['any'], :tags => ['~FC041'] }
end
+Rake::TestTask.new do |t|
+ t.name = "unit"
+ t.test_files = FileList['test/unit/**/*_spec.rb']
+ t.verbose = true
+end
+
begin
require 'jamie/rake_tasks'
Jamie::RakeTasks.new
rescue LoadError
puts ">>>>> Jamie gem not loaded, omitting tasks" unless ENV['CI']
end
-task :default => [:foodcritic]
+task :default => [:foodcritic, :unit]
@@ -0,0 +1,4 @@
+{
+ "id": "virgil1"
+}
+
@@ -0,0 +1,4 @@
+{
+ "id": "virgil2"
+}
+
@@ -0,0 +1,13 @@
+#!/usr/bin/env bats
+
+@test "virgil1 user has rvm-1.17.10" {
+ run sudo -u virgil1 -i rvm version
+ [ $status -eq 0 ]
+ [ "$(echo $output | awk '{print $2}')" = "1.17.10" ]
+}
+
+@test "virgil2 user has rvm-1.16.20" {
+ run sudo -u virgil2 -i rvm version
+ [ $status -eq 0 ]
+ [ "$(echo $output | awk '{print $2}')" = "1.16.20" ]
+}

0 comments on commit 88ee8bb

Please sign in to comment.