Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/warbler/web_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def local_path
FileUtils.mkdir_p File.dirname(cached_path) #:nocov:
require 'open-uri' #:nocov:
begin
open(download_url) do |stream| #:nocov:
URI.open(download_url) do |stream| #:nocov:
File.open(cached_path, "wb") do |f| #:nocov:
while buf = stream.read(4096) #:nocov:
f << buf #:nocov:
Expand Down
8 changes: 5 additions & 3 deletions spec/warbler/web_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ def self.reset_local_repository

describe Warbler::WebServer::Artifact do

@@_env = ENV.to_h

after(:all) { ENV.clear; ENV.update @@_env }
before(:all) do
@_env = ENV.to_h
end

before do
Warbler::WebServer::Artifact.reset_local_repository
end

after(:all) do
Warbler::WebServer::Artifact.reset_local_repository
ENV.clear
ENV.update @_env
end

let(:sample_artifact) do
Expand Down
Loading