Sha256: 5771a6838ce08eb6a93d1c827c5a3ae672c42143cfd72eb8f7ecf87f658f2527

Contents?: true

Size: 1.28 KB

Versions: 30

Compression:

Stored size: 1.28 KB

Contents

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

describe JenkinsPipelineBuilder::JobCollection 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

  before :each do
    JenkinsPipelineBuilder.debug!
  end

  context '#load_from_path' do
    before :all do
      path = File.expand_path('../fixtures/job_collection/', __FILE__)
      described_class.new.load_from_path path
    end

    after :all do
      JenkinsPipelineBuilder.registry.registry[:job][:publishers].delete(:my_test_thing)
    end

    it 'loads extensions' do
      expect(JenkinsPipelineBuilder.registry.registry[:job][:publishers]).to have_key :my_test_thing
    end

    it 'loads extension helpers' do
      extension = JenkinsPipelineBuilder.registry.registry[:job][:publishers][:my_test_thing].extension
      builder = Nokogiri::XML::Builder.new { |xml| xml.publishers }
      xml = builder.doc
      expect(extension.execute({}, xml)).to be true
      node = xml.css('thing').first
      expect(node.name).to eq 'thing'
      expect(node.content).to eq 'cool_stuff_method'
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
jenkins_pipeline_builder-1.7.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.5.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.3.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.2.1 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.2.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.1.5 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.1.4 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.1.3 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.1.2 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.1.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-1.0.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.16.3 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.16.2 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.16.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.15.3 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.15.2 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.15.1 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.14.0 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.13.4 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb
jenkins_pipeline_builder-0.13.3 spec/lib/jenkins_pipeline_builder/job_collection_spec.rb