File: archive_assemble_nexus_url_spec.rb

package info (click to toggle)
puppet-module-voxpupuli-archive 7.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 744 kB
  • sloc: ruby: 2,483; sh: 10; makefile: 4
file content (37 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

require 'spec_helper'

describe 'archive::assemble_nexus_url' do
  let(:nexus_url) { 'http://nexus.local' }

  it { is_expected.not_to be_nil }

  it 'builds url correctly' do
    expected_url = 'http://nexus.local/service/local/artifact/maven/content?g=com.test&a=test&v=1.0.0&r=binary-staging&p=ear'

    parameters = {
      'g' => 'com.test',
      'a' => 'test',
      'v' => '1.0.0',
      'r' => 'binary-staging',
      'p' => 'ear'
    }

    expect(subject).to run.with_params(nexus_url, parameters).and_return(expected_url)
  end

  it 'builds url with version containing "+" sign correctly' do
    expected_url = 'http://nexus.local/service/local/artifact/maven/content?g=com.test&a=test&v=1.0.0%2B11&r=binary-staging&p=ear'

    parameters = {
      'g' => 'com.test',
      'a' => 'test',
      'v' => '1.0.0+11',
      'r' => 'binary-staging',
      'p' => 'ear'
    }

    expect(subject).to run.with_params(nexus_url, parameters).and_return(expected_url)
  end
end