forked from blt04/puppet-rvm
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from walkamongus/rvm_autolibs_refactor
Convert rvm_system_ruby autolib_mode to parameter
- Loading branch information
Showing
3 changed files
with
41 additions
and
11 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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'spec_helper' | ||
require 'puppet' | ||
require 'puppet/type/rvm_system_ruby' | ||
|
||
describe Puppet::Type.type(:rvm_system_ruby) do | ||
context 'with autolib_mode set' do | ||
it 'should not raise error' do | ||
expect do | ||
Puppet::Type.type(:rvm_system_ruby).new(:name => 'ruby-1.9.3-p448', :autolib_mode => 'enabled') | ||
end.not_to raise_error | ||
end | ||
|
||
it 'should set mode correctly' do | ||
@system_ruby = Puppet::Type.type(:rvm_system_ruby).new(:name => 'jruby-1.7.6', :autolib_mode => 'read-fail') | ||
expect(@system_ruby[:autolib_mode]).to eq('read-fail') | ||
end | ||
end | ||
|
||
it 'should error on an incorrect autolib_mode' do | ||
expect do | ||
Puppet::Type.type(:rvm_system_ruby).new(:name => 'ruby-1.9.3-p448', :autolib_mode => 'foo') | ||
end.to raise_error(Puppet::ResourceError, /Invalid autolib mode: foo/) | ||
end | ||
end |