Sha256: 7410984b1578acfd04513b611be18ad70e79e575b68f59445340b632776f5fcb

Contents?: true

Size: 723 Bytes

Versions: 9

Compression:

Stored size: 723 Bytes

Contents

require File.expand_path('../spec_helper', __FILE__)

include GivenFilesystemSpecHelpers

describe Downloader do

  use_given_filesystem

  include_context "manifest_files"
  
  it "downloads source tarball" do
    mh = ManifestHandler.new(settings)
    mh.read_remote

    output = double
    expect(output).to receive(:puts).at_least(:once)

    downloader = Downloader.new(mh, output)

    expect(downloader).to receive(:read_from_url).and_return("dummy tarball")

    path = given_directory

    downloader.download("awesomelib", path)

    tarball_path = File.join(path, "awesomelib-0.2.0.tar.gz")

    expect(File.exists?(tarball_path)).to be true
    expect(File.read(tarball_path)).to eq "dummy tarball"
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inqlude-0.12.0 spec/unit/downloader_spec.rb
inqlude-0.11.0 spec/unit/downloader_spec.rb
inqlude-0.10.0 spec/unit/downloader_spec.rb
inqlude-0.9.0 spec/unit/downloader_spec.rb
inqlude-0.8.0 spec/unit/downloader_spec.rb
inqlude-0.7.4 spec/unit/downloader_spec.rb
inqlude-0.7.3 spec/unit/downloader_spec.rb
inqlude-0.7.2 spec/unit/downloader_spec.rb
inqlude-0.7.1 spec/unit/downloader_spec.rb