I use this one to set parameters for a define in my rspec

  let(:facts) { { :hostname => 'sambaserver' } }

  context 'default setting' do
    let(:params) { { :share_path => '/testpath/share' } }
    ...
  end

this is an expert of my define

define samba::define_share (
  share_path,
  share_browsable   = $samba::params::share_browsable,
  share_readonly    = $samba::params::share_readonly,
  share_write_list  = $samba::params::share_write_list,
  share_valid_users = $samba::params::share_valid_users,
..... )

hope this helps

Grt
Johan

On 12/24/2013 02:50 PM, [email protected] wrote:
Hi all,

I'm trying to test a defined type that looks like this:

define app_setup::app($app_name = $title) {
  include app_setup::params

  $app_host       = $app_setup::params::app_hosts[$app_name]['url']
  $app_port       = $app_setup::params::app_hosts[$app_name]['port']
  $deploy_user    = $app_setup::params::deploy_user

   ...
}

And I'm trying to write a spec like this:

describe 'app_setup::app', :type => :define do
  let(:title) { 'some_app_name' }

end

My question is, how can I assign the values of $app_setup::params::app_hosts in the spec? I tried several combinations of 'let' but didn't work.

Thanks,
Vamsee.


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6b1ca94d-97b6-4e1b-8c62-5b5ed1478705%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer         (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
Open-Future Phone +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________
Next Events:
Puppet Advanced Training | 
http://www.open-future.be/puppet-advanced-training-7-till-9th-january
Puppet Fundamentals Training | 
http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52BBFD5C.7040705%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to