Sha256: d3fa39545902c9fe6aeac2e5e4f4deebf519b3a234afedff25eeb93f5195ec96

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 Bytes

Contents

require_relative './test_xml_generator'

class TestCucumberPublisher < Test::Unit::TestCase
  def test_postbuild_cucumber_json_publisher
    file_location = 'cucumber/results.json'
    ignore_bad_results = 'false'

    builder = JenkinsJob::Builder.new

    builder.freestyle 'foo' do
      postbuild do
        cucumber_json_publisher do
          test_results file_location
          ignore_bad_tests ignore_bad_results
        end
      end
    end

    actual = builder.config_as_xml_node('foo')

    {
      'testResults' => file_location,
      'ignoreBadSteps' => ignore_bad_results,
    }.each do |k, v|
      path = ['./project/publishers/org.jenkinsci.plugins.cucumber.',
              "jsontestsupport.CucumberTestResultArchiver/#{k}"].join('')
      assert_equal v, actual.xpath(path).text
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubyjobbuilderdsl-0.0.8 test/test_cucumber_json_publisher.rb
rubyjobbuilderdsl-0.0.6 test/test_cucumber_json_publisher.rb
rubyjobbuilderdsl-0.0.4 test/test_cucumber_json_publisher.rb