diff --git a/manifests/install.pp b/manifests/install.pp index 4451adf..d1c91bb 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -44,4 +44,9 @@ path => ['/bin', '/usr/bin', '/usr/sbin'], require => File["rbenv::rbenvrc ${user}"], } + + file { "rbenv::cache-dir ${user}": + ensure => directory, + path => "${root_path}/cache" + } } diff --git a/spec/defines/rbenv__install_spec.rb b/spec/defines/rbenv__install_spec.rb index 68c9f41..a135a17 100644 --- a/spec/defines/rbenv__install_spec.rb +++ b/spec/defines/rbenv__install_spec.rb @@ -15,5 +15,10 @@ should contain_exec("rbenv::shrc #{user}"). with_command("echo 'source /home/#{user}/.rbenvrc' >> /home/#{user}/.profile") end + + it "creates a cache folder" do + should contain_file("rbenv::cache-dir #{user}"). + with(:ensure => "directory", :path => "/home/#{user}/.rbenv/cache") + end end end