Sha256: ada6e5176a1720c4d4bc51a863cff8de01f2884dee1d4be500df25ca25d6747d

Contents?: true

Size: 680 Bytes

Versions: 4

Compression:

Stored size: 680 Bytes

Contents

module Polytrix
  module Core
    describe FileSystemHelper do
      subject(:finder) do
        Object.new.extend(Polytrix::Core::FileSystemHelper)
      end

      it 'finds files within the search path' do
        search_path = 'spec/fixtures/src-doc'
        file = finder.find_file search_path, 'quine'
        expect(file.relative_path_from path(search_path)).to eq(path('quine.md.erb'))
      end

      it 'raises FileNotFound except if a file is not found' do
        expect { finder.find_file 'spec/fixtures/src-doc', 'quinez' }.to raise_error FileSystemHelper::FileNotFound
      end

      private

      def path(p)
        Pathname.new p
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polytrix-0.1.2 spec/polytrix/file_finder_spec.rb
polytrix-0.1.1 spec/polytrix/file_finder_spec.rb
polytrix-0.1.0 spec/polytrix/file_finder_spec.rb
polytrix-0.1.0.pre spec/polytrix/file_finder_spec.rb