Sha256: 99e76111b163200c771db8e4906f753dd8b959ad40e31fd85c03b46176b2c02b

Contents?: true

Size: 873 Bytes

Versions: 3

Compression:

Stored size: 873 Bytes

Contents

require 'spec_helper'

describe Rake::Path do
  let(:existing_file_path) { '/path/to/a/file' }
  let(:file_glob) { '/path/glob/*' }
  let(:file_list) { ['FILE', 'LIST'] }
  let(:a_path) { '/a/path' }

  context '.find_files' do
    it 'returns files passed in' do
      File.should_receive(:file?).with(existing_file_path).and_return(true)

      expect(Rake::Path.find_files([existing_file_path], 'c')).to eq([existing_file_path])
    end

    it 'returns a file list for globs' do
      FileList.should_receive(:[]).with(file_glob).and_return(file_list)

      expect(Rake::Path.find_files([file_glob], 'c')).to eq(file_list)
    end

    it 'searches for files with the given extension under a path' do
      FileList.should_receive(:[]).with(a_path + '/*.c').and_return(file_list)

      expect(Rake::Path.find_files([a_path], 'c')).to eq(file_list)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rake-builder-0.9.2 spec/unit/rake/path_spec.rb
rake-builder-0.9.1 spec/unit/rake/path_spec.rb
rake-builder-0.9.0 spec/unit/rake/path_spec.rb