Sha256: a3f7e26f683922be466f95f107cea015ff4d2f2897f0d5e8be3ccda4a4527130
Contents?: true
Size: 1.05 KB
Versions: 63
Compression:
Stored size: 1.05 KB
Contents
describe Ufo::Ecr::Auth do let(:repo_domain) { "123456789.dkr.ecr.us-east-1.amazonaws.com" } let(:auth) { Ufo::Ecr::Auth.new(repo_domain) } before(:each) do allow(auth).to receive(:fetch_auth_token).and_return("opensesame") end context("update") do before(:each) do clean_home end context("missing ~/.docker/config.json") do it "should create the auth token" do auth.update data = JSON.load(IO.read("spec/fixtures/home/.docker/config.json")) auth_token = data["auths"][repo_domain]["auth"] expect(auth_token).to eq("opensesame") end end context("existing ~/.docker/config.json") do it "should update the auth token" do auth.update data = JSON.load(IO.read("spec/fixtures/home/.docker/config.json")) auth_token = data["auths"][repo_domain]["auth"] expect(auth_token).to eq("opensesame") end end end def clean_home FileUtils.rm_rf("spec/fixtures/home") FileUtils.cp_r("spec/fixtures/home_existing", "spec/fixtures/home") end end
Version data entries
63 entries across 63 versions & 1 rubygems