I am adding  spec tests to my modules and have run into an issue I can't seem 
to figure out.

I have a simple class: (ruby/manifests/init.pp)
class ruby {
  include common
  $blah = dirname('/tmp/test/file.txt')
  file { $blah: ensure => director }
}

And a spec file: (spec/classes/ruby_init_spec.rb)
require 'spec_helper'
describe 'ruby', :type => :class do
  it { should contain_file('/tmp/test') }
end

I have a simple define: (ruby/manifests/thin.pp)
define ruby::thin {
  include common
  $blah = dirname('/tmp/test/file.txt')
  file { $blah: ensure => director }
}

And a spec file: (spec/defines/ruby_thin_spec.rb)
require 'spec_helper'
describe 'ruby::thin', :type => :define do
  let(:title) { 'test_site' }
  it { should contain_file('/tmp/test') }  
end

My .fixtures.yml contains:
fixtures:
  repositories:
    common: gitol...@git.mycompany.com:puppet/mycompany-common.git
  symlinks:
    ruby: "#{source_dir}"

common/lib/puppet/parser/functions/dirname.rb exists and is based off of 
https://github.com/camptocamp/puppet-common/blob/master/lib/puppet/parser/functions/dirname.rb.
  I've been using it for a very long time without issue.


Any thoughts as to what I'm missing?  I think I've narrowed it down to a class 
works and the define does not.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to