Sha256: 19da133a824075a9e1d958374c1182cae81783811a39296388faf6e4d51e950b
Contents?: true
Size: 977 Bytes
Versions: 2
Compression:
Stored size: 977 Bytes
Contents
require "spec_helper" RSpec.describe Fontist::Utils::Downloader do describe ".download" do it "return the valid downloaded file" do tempfile = Fontist::Utils::Downloader.download( sample_file[:file], sha: sample_file[:sha], file_size: sample_file[:file_size], ) expect(tempfile).not_to be_nil expect(tempfile.size).to eq(sample_file[:file_size]) end it "raises an error for tempared file" do expect{ Fontist::Utils::Downloader.download( sample_file[:file], sha: sample_file[:sha] + "mm", file_size: sample_file[:file_size] ) }.to raise_error(Fontist::Errors::TamperedFileError) end end def sample_file @sample_file ||= { file_size: 150899, file: "https://drive.google.com/u/0/uc?id=1Kk-rpLyQk98ubgxhTRKD2ZkMoY9KqKXk&export=download", sha: "5e513e4bfdada0ff10dd5b96414fcaeade84e235ce043865416ad7673cb6f3d8" } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fontist-1.3.0 | spec/fontist/utils/downloader_spec.rb |
fontist-1.2.1 | spec/fontist/utils/downloader_spec.rb |