Sha256: 57a0294a30ed6275fd3262b9a52fd8dd5aa88f1ffaea5a3813d860066cc3cc5d

Contents?: true

Size: 1.13 KB

Versions: 15

Compression:

Stored size: 1.13 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

describe 'extension dsl' do
  before :all do
    JenkinsPipelineBuilder.credentials = {
      server_ip: '127.0.0.1',
      server_port: 8080,
      username: 'username',
      password: 'password',
      log_location: '/dev/null'
    }
  end

  after :each do
    JenkinsPipelineBuilder.registry.clear_versions
  end

  it 'overrides included extensions with local ones' do
    builder do
      name :shell_command
      plugin_id 'builtin'
      description 'Lets you run shell commands as a build step.'
      jenkins_name 'Execute shell'
      announced false

      xml do |param|
        newShell do
          command param
        end
      end
    end

    allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
      list_installed: { 'parameterized-trigger' => '20.0' }
    )

    @n_xml = Nokogiri::XML::Builder.new { |xml| xml.builders }.doc
    params = { builders: { shell_command: 'asdf' } }
    JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)

    builder = @n_xml.root.children.first
    expect(builder.name).to match 'newShell'
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jenkins_pipeline_builder-1.7.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.5.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.3.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.2.1 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.2.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.1.5 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.1.4 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.1.3 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.1.2 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.1.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-1.0.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-0.16.3 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-0.16.2 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-0.16.0 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb
jenkins_pipeline_builder-0.15.3 spec/lib/jenkins_pipeline_builder/extension_dsl_spec.rb