Sha256: 3cd9fda70998e89235bf9c9d02797a3f40e0bcea5ea697336c2bdb3c39713fbd

Contents?: true

Size: 1.12 KB

Versions: 22

Compression:

Stored size: 1.12 KB

Contents

#! /usr/bin/env ruby -S rspec
require 'spec_helper'

require 'rspec-puppet'
describe 'getparam' do
  describe 'when a resource is not specified' do
    it do
      should run.with_params().and_raise_error(ArgumentError)
      should run.with_params('User[dan]').and_raise_error(ArgumentError)
      should run.with_params('User[dan]', {}).and_raise_error(ArgumentError)
      should run.with_params('User[dan]', '').and_return('')
    end
  end
  describe 'when compared against a resource with no params' do
    let :pre_condition do
      'user { "dan": }'
    end
    it do
      should run.with_params('User[dan]', 'shell').and_return('')
    end
  end

  describe 'when compared against a resource with params' do
    let :pre_condition do
      'user { "dan": ensure => present, shell => "/bin/sh", managehome => false}'
    end
    it do
      should run.with_params('User[dan]', 'shell').and_return('/bin/sh')
      should run.with_params('User[dan]', '').and_return('')
      should run.with_params('User[dan]', 'ensure').and_return('present')
      should run.with_params('User[dan]', 'managehome').and_return(false)
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
freighthop-0.6.1 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.6.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.5.2 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.5.1 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.5.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.4.1 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.4.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.3.3 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.3.2 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.3.1 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.3.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.2.1 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.2.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.1.0 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.6 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.5 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.4 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.3 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.2 modules/stdlib/spec/functions/getparam_spec.rb
freighthop-0.0.1 modules/stdlib/spec/functions/getparam_spec.rb