diff options
author | Chris Price <chris@puppetlabs.com> | 2012-06-26 17:44:39 -0700 |
---|---|---|
committer | Chris Price <chris@puppetlabs.com> | 2012-06-26 17:44:39 -0700 |
commit | 29f8f89c19b2189aa78ab430e94671669cb4716c (patch) | |
tree | 51b8c47d5576217b4bc8bf45510f38790b43b806 /spec/lib/puppet_spec/fixtures.rb | |
parent | e299ac6212b0468426f971b216447ef6bc679149 (diff) | |
parent | d9410f72e416da15eb1660d15ba2b4288ccc0873 (diff) |
Merge pull request #73 from branan/use_spechelper_gem
Update for new gem version of puppetlabs_spec_helper
Diffstat (limited to 'spec/lib/puppet_spec/fixtures.rb')
-rwxr-xr-x | spec/lib/puppet_spec/fixtures.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/spec/lib/puppet_spec/fixtures.rb b/spec/lib/puppet_spec/fixtures.rb deleted file mode 100755 index 7f6bc2a..0000000 --- a/spec/lib/puppet_spec/fixtures.rb +++ /dev/null @@ -1,28 +0,0 @@ -module PuppetSpec::Fixtures - def fixtures(*rest) - File.join(PuppetSpec::FIXTURE_DIR, *rest) - end - def my_fixture_dir - callers = caller - while line = callers.shift do - next unless found = line.match(%r{/spec/(.*)_spec\.rb:}) - return fixtures(found[1]) - end - fail "sorry, I couldn't work out your path from the caller stack!" - end - def my_fixture(name) - file = File.join(my_fixture_dir, name) - unless File.readable? file then - fail Puppet::DevError, "fixture '#{name}' for #{my_fixture_dir} is not readable" - end - return file - end - def my_fixtures(glob = '*', flags = 0) - files = Dir.glob(File.join(my_fixture_dir, glob), flags) - unless files.length > 0 then - fail Puppet::DevError, "fixture '#{glob}' for #{my_fixture_dir} had no files!" - end - block_given? and files.each do |file| yield file end - files - end -end |