Sha256: 3ff81b557281b5164eb9c5bf6c912d487b565cfd80ee8b7cfa92950d8bad189a

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe 'rbenv::definition', :type => :define do
  let(:user)         { 'tester' }
  let(:ruby_version) { '1.9.3-p125' }
  let(:title)        { "rbenv::definition::#{user}::#{ruby_version}" }
  let(:dot_rbenv)    { "/home/#{user}/.rbenv" }
  let(:target_path)  { "#{dot_rbenv}/plugins/ruby-build/share/ruby-build/#{ruby_version}" }
  let(:params)       { {:user => user, :ruby => ruby_version, :source => definition} }

  context 'puppet' do
    let(:definition)   { 'puppet:///custom-definition' }
    it 'copies the file to the right path' do
      should contain_file("rbenv::definition-file #{user} #{ruby_version}").with(
        :path => target_path,
        :source  => definition
      )
    end
  end

  context 'http' do
    let(:definition) { 'http://gist.com/ree' }
    it 'downloads file to the right path' do
      should contain_exec("rbenv::definition-file #{user} #{ruby_version}").with(
        :command => "wget #{definition} -O #{target_path}",
        :creates => target_path
      )
    end
  end

  context 'https' do
    let(:definition) { 'https://gist.com/ree' }
    it 'downloads file to the right path' do
      should contain_exec("rbenv::definition-file #{user} #{ruby_version}").with(
        :command => "wget #{definition} -O #{target_path}",
        :creates => target_path
      )
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.6.0 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.5.2 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.5.1 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.5.0 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.4.1 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.4.0 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.3.3 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.3.2 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.3.1 modules/rbenv/spec/defines/rbenv__definition_spec.rb
freighthop-0.3.0 modules/rbenv/spec/defines/rbenv__definition_spec.rb