Sha256: d9a67406e444ea355c3ab7ca1421d063f80ea926c4c527a08929134d27796f9c

Contents?: true

Size: 1014 Bytes

Versions: 5

Compression:

Stored size: 1014 Bytes

Contents

require_relative './test_xml_generator'

class TestXmlAnt < Test::Unit::TestCase
  def test_ant
    builder = JenkinsJob::Builder.new

    builder.freestyle 'foo' do
      ant do
        target 'clean', 'lint'
        buildfile 'foo.xml'
        java_opts '-Xmx512m', '-Xms512m'
        property 'skipTest' => 'false'
      end
    end

    actual = builder.config_as_xml_node('foo')
    { 'hudson.tasks.Ant/targets' => 'clean lint',
      'hudson.tasks.Ant/buildFile' => 'foo.xml',
      'hudson.tasks.Ant/properties' => '-DskipTest=false',
      'hudson.tasks.Ant/antOpts' => '-Xmx512m -Xms512m',
    }.each do |k, v|
      assert_equal v, actual.xpath('./project/builders/' \
          "#{k}").text, k
    end
  end

  def test_ant_defalt_target
    builder = JenkinsJob::Builder.new

    builder.freestyle 'foo' do
      ant do
      end
    end

    actual = builder.config_as_xml_node('foo')
    assert actual.at('./project/builders/hudson.tasks.Ant/targets')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubyjobbuilderdsl-0.0.5 test/test_ant.rb
rubyjobbuilderdsl-0.0.3 test/test_ant.rb
rubyjobbuilderdsl-0.0.2 test/test_ant.rb
rubyjobbuilderdsl-0.0.1 test/test_ant.rb
rubyjobbuilderdsl-0.0.0 test/test_ant.rb