Skip to content

Commit

Permalink
Refactor environment handling in web server spec
Browse files Browse the repository at this point in the history
Class variable access from top level gives RuntimeError
  • Loading branch information
laumacirule committed Oct 4, 2024
1 parent 3756c6c commit d010e53
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit d010e53

Please sign in to comment.