Sha256: 5890b2456a5c87e83410013c51e125da9cc2aabc662d3c0f790d651266bdfe7c

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

require 'rspec'
require 'rspec/matchers'

require 'simplecov'
require 'simplecov-rcov'
require 'webmock/rspec'
require 'equivalent-xml'

require File.expand_path('../../../../lib/jenkins_pipeline_builder', __FILE__)

RSpec::Matchers.define :have_min_version do |version|
  match do |base|
    @set = base
    !base.extensions.select { |ext| ext.min_version == version }.empty?
  end

  failure_message do
    versions = @set.map(&:min_version).join(', ')
    "Expected to find extension #{@set.name} with version #{version}, found #{versions} instead"
  end
end

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

RSpec::Matchers.define :have_registered_versions do |versions|
  match do |set|
    @set = set
    @registered_versions = set.versions.keys.map(&:version)
    @registered_versions.sort == versions.sort
  end

  failure_message do
    "Expected #{@set.name} to have registered versions #{versions}. Got #{@registered_versions}"
  end
end

def parse_expectation_xml(xml_string)
  Nokogiri::XML.parse(xml_string, &:noblanks)
end

Version data entries

14 entries across 14 versions & 1 rubygems

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