1 module PuppetSpec::Fixtures
3 File.join(PuppetSpec::FIXTURE_DIR, *rest)
7 while line = callers.shift do
8 next unless found = line.match(%r{/spec/(.*)_spec\.rb:})
9 return fixtures(found[1])
11 fail "sorry, I couldn't work out your path from the caller stack!"
14 file = File.join(my_fixture_dir, name)
15 unless File.readable? file then
16 fail Puppet::DevError, "fixture '#{name}' for #{my_fixture_dir} is not readable"
20 def my_fixtures(glob = '*', flags = 0)
21 files = Dir.glob(File.join(my_fixture_dir, glob), flags)
22 unless files.length > 0 then
23 fail Puppet::DevError, "fixture '#{glob}' for #{my_fixture_dir} had no files!"
25 block_given? and files.each do |file| yield file end