Sha256: a80bcee372a7260fef38d64bb2297fb9d032e5b442e39c7c8539cf25aee799a1

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe 'rbenv::plugin', :type => :define do
  let(:user)        { 'tester' }
  let(:plugin_name) { 'rbenv-vars' }
  let(:dot_rbenv)   { "/home/#{user}/.rbenv" }
  let(:source)      { 'git://github.com/rbenv/plugin' }
  let(:title)       { "rbenv::plugin::#{user}::#{plugin_name}" }
  let(:params)      { {:user => user, :plugin_name => plugin_name, :source => source} }

  let(:target_path) { "#{dot_rbenv}/plugins/#{plugin_name}" }

  it 'clones repository to the right path' do
    should contain_exec("rbenv::plugin::checkout #{user} #{plugin_name}").with(
      :command => "git clone #{source} #{target_path}",
      :user    => user,
      :creates => target_path,
      :require => /rbenv::plugins #{user}/
    )
  end

  context 'with source != git' do
    let(:source) { 'something != git' }

    it 'fails informing that it is not supported yet' do
      expect {
        should contain_exec("rbenv::plugin::checkout #{user} #{plugin_name}")
      }.to raise_error(Puppet::Error, /Only git plugins are supported/)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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