Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 88ee8bb8b83f986192d13e9837e2d63e7b7c3317 1 parent c592584
@fnichol fnichol authored
View
14 .jamie.yml
@@ -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
9 Rakefile
@@ -1,6 +1,7 @@
#!/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.
@@ -8,6 +9,12 @@ 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
@@ -15,4 +22,4 @@ rescue LoadError
puts ">>>>> Jamie gem not loaded, omitting tasks" unless ENV['CI']
end
-task :default => [:foodcritic]
+task :default => [:foodcritic, :unit]
View
4 test/integration/data_bags/users/virgil1.json
@@ -0,0 +1,4 @@
+{
+ "id": "virgil1"
+}
+
View
4 test/integration/data_bags/users/virgil2.json
@@ -0,0 +1,4 @@
+{
+ "id": "virgil2"
+}
+
View
13 test/integration/rvm_versions/bats/version_pinning.bats
@@ -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" ]
+}
Please sign in to comment.
Something went wrong with that request. Please try again.