Skip to content

Commit

Permalink
Added zip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shams-ahmed committed Oct 28, 2020
1 parent a76a8f8 commit 8438a8d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/step_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'zip'
require_relative './../functions.rb'

describe 'download_library' do
Expand All @@ -15,6 +16,24 @@
expect(f.original_filename).to eq("libTrace.a.zip")
end

it 'validate zip file contains SDK' do
lib_version = "latest"
hasSDK = false

f = download_library("https://monitoring-sdk.firebaseapp.com/#{lib_version}/libTrace.a.zip")

Zip::File.open(f.path) do |zip_file|
zip_file.each do |f|
if f.name == "libTrace.a"
hasSDK = true
end
end
end

expect(hasSDK).to be true
expect(f.original_filename).to eq("libTrace.a.zip")
end

it 'raises error if url is 404' do
lib_version = "nonexistent"
expect {
Expand Down

0 comments on commit 8438a8d

Please sign in to comment.