Sha256: a67b19e1a96cf1f5fe87a5b29114c6502a143eb045ce406e06aed0634a5aa40c

Contents?: true

Size: 753 Bytes

Versions: 11

Compression:

Stored size: 753 Bytes

Contents

require 'remi_spec'

describe Extractor::LocalFile do
  let(:remote_path) { "#{Pathname.new(__FILE__).dirname}" }

  let(:local_file) {
    Extractor::LocalFile.new(
      remote_path: remote_path
    )
  }

  let(:remote_filenames) { Dir[remote_path + '/*'].map { |f| Pathname.new(f).basename.to_s } }

  context '.new' do
    it 'creates an instance with valid parameters' do
      local_file
    end
  end

  context '#all_entires' do
    it 'returns all entries' do
      expect(local_file.all_entries.map(&:name)).to eq remote_filenames
    end
  end

  context '#extract' do
    it 'references local files with the right names' do
      expect(local_file.extract.map { |f| Pathname.new(f).basename.to_s }).to eq remote_filenames
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
remi-0.3.3 spec/data_subjects/local_file_spec.rb
remi-0.3.2 spec/data_subjects/local_file_spec.rb
remi-0.3.1 spec/data_subjects/local_file_spec.rb
remi-0.3.0 spec/data_subjects/local_file_spec.rb
remi-0.2.42 spec/extractor/local_file_spec.rb
remi-0.2.41 spec/extractor/local_file_spec.rb
remi-0.2.40 spec/extractor/local_file_spec.rb
remi-0.2.39 spec/extractor/local_file_spec.rb
remi-0.2.38 spec/extractor/local_file_spec.rb
remi-0.2.37 spec/extractor/local_file_spec.rb
remi-0.2.36 spec/extractor/local_file_spec.rb