Sha256: 666c18ab1b181bd3c069a0a412885c73059ad55ef2b59f4f306299a10e00b2e8

Contents?: true

Size: 835 Bytes

Versions: 2

Compression:

Stored size: 835 Bytes

Contents

module HeadChef
  module RSpec
    module PathHelpers
      def tmp_path
        HeadChef.root.join('tmp')
      end

      def fixtures_path
        HeadChef.root.join('spec/fixtures')
      end

      def berkshelf_path
        tmp_path.join('.berkshelf').expand_path
      end

      def cookbook_store
        fixtures_path.join('cookbooks').expand_path
      end

      def cookbook_path(cookbook_name)
        "#{cookbook_store}/#{cookbook_name}"
      end

      def file_content_conflict_path(cookbook_name)
        "#{cookbook_path(cookbook_name)}_file_content_conflict"
      end

      def file_list_conflict_path(cookbook_name)
        "#{cookbook_path(cookbook_name)}_file_list_conflict"
      end

      def clean_tmp_path
        FileUtils.rm_rf(tmp_path)
        FileUtils.mkdir_p(tmp_path)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
head_chef-0.1.1 spec/support/path_helpers.rb
head_chef-0.1.0 spec/support/path_helpers.rb