Sha256: 7b9232d764cb48c5a2d7302acc5c9f7a15a921b0d7b40098ac67c0df87161850

Contents?: true

Size: 1.38 KB

Versions: 10

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'rexml/document'

describe KPM::NexusFacade, skip_me_if_nil: ENV['TOKEN'].nil? do
  let(:logger) do
    logger = ::Logger.new(STDOUT)
    logger.level = Logger::INFO
    logger
  end
  let(:coordinates_map) do
    { version: '1.1.9',
      group_id: 'org.kill-bill.billing.thirdparty',
      artifact_id: 'qualpay-java-client',
      packaging: 'pom',
      classifier: nil }
  end
  let(:coordinates) { KPM::Coordinates.build_coordinates(coordinates_map) }
  let(:nexus_remote) { described_class::GithubApiCalls.new({ :url => 'https://maven.pkg.github.com/killbill/qualpay-java-client', :token => ENV['TOKEN'] }, true, logger) }

  it {
    # Not implemented
    expect { nexus_remote.search_for_artifacts(coordinates) }.to raise_exception(NoMethodError, 'GitHub Packages has no search support')
  }

  it {
    response = nil
    expect { response = nexus_remote.get_artifact_info(coordinates) }.not_to raise_exception
    expect(REXML::Document.new(response).elements['//version'].text).to eq(coordinates_map[:version])
  }

  it {
    response = nil
    destination = Dir.mktmpdir('artifact')
    expect { response = nexus_remote.pull_artifact(coordinates, destination) }.not_to raise_exception
    destination = File.join(File.expand_path(destination), response[:file_name])
    expect(File.read(destination)).to match(/qualpay-java-client/)
  }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kpm-0.10.6 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.11.1 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.5 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.11.0 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.4 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.3 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.2 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.1 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.10.0 spec/kpm/remote/github_api_calls_spec.rb
kpm-0.9.0 spec/kpm/remote/github_api_calls_spec.rb