Sha256: af7c48a67993a4fc3db9fa4e364e8b6e2305ff731e257dab9a989293c494b5c8

Contents?: true

Size: 1.22 KB

Versions: 9

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'

describe Minimart::Utils::FileHelper do

  subject { Minimart::Utils::FileHelper }

  let(:cookbook_path) { 'spec/fixtures/sample_cookbook/' }

  describe '::cookbook_path_in_directory' do
    describe 'when the path passed is a cookbook' do
      it 'should return the path to the cookbook' do
        expect(subject.cookbook_path_in_directory(cookbook_path)).to eq cookbook_path
      end
    end

    describe 'when a cookbook is found one level deep in the directory structure' do
      it 'should return the path to the cookbook' do
        expect(subject.cookbook_path_in_directory('spec/fixtures')).to eq cookbook_path
      end
    end

    describe 'when no cookbook is found' do
      it 'should return nil' do
        expect(subject.cookbook_path_in_directory('spec/')).to eq nil
      end
    end
  end

  describe '::cookbook_in_path?' do
    describe 'when the path passed is a cookbook' do
      it 'should return true' do
        expect(subject.cookbook_in_path?('spec/fixtures/sample_cookbook')).to eq true
      end
    end

    describe 'when the path passed is not a cookbook' do
      it 'should return false' do
        expect(subject.cookbook_in_path?('spec/')).to eq false
      end
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.2.4 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.2.3 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.2.0 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.1.6 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.1.3 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.0.2 spec/lib/minimart/utils/file_helper_spec.rb
minimart-1.0.1 spec/lib/minimart/utils/file_helper_spec.rb
minimart-0.0.1 spec/lib/minimart/utils/file_helper_spec.rb