rubyjobbuilderdsl 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +13 -5
  2. data/Gemfile +6 -6
  3. data/Gemfile.lock +41 -41
  4. data/LICENSE +18 -18
  5. data/Rakefile +12 -12
  6. data/docs/common.md +313 -313
  7. data/docs/flow.md +17 -17
  8. data/docs/freestyle.md +100 -100
  9. data/docs/gerrit.md +70 -70
  10. data/docs/git.md +88 -88
  11. data/docs/multi.md +26 -26
  12. data/docs/overview.md +74 -74
  13. data/docs/postbuild.md +266 -266
  14. data/docs/view.md +13 -13
  15. data/lib/rubyjobbuilderdsl.rb +2 -2
  16. data/lib/rubyjobbuilderdsl/buildstep/ant.rb +29 -29
  17. data/lib/rubyjobbuilderdsl/buildstep/copyartifact.rb +23 -23
  18. data/lib/rubyjobbuilderdsl/buildstep/inject_env.rb +18 -18
  19. data/lib/rubyjobbuilderdsl/buildstep/phase.rb +19 -19
  20. data/lib/rubyjobbuilderdsl/buildstep/phase_job.rb +26 -26
  21. data/lib/rubyjobbuilderdsl/buildstep/shell.rb +24 -24
  22. data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -46
  23. data/lib/rubyjobbuilderdsl/common.rb +140 -140
  24. data/lib/rubyjobbuilderdsl/common/artifactory.rb +33 -33
  25. data/lib/rubyjobbuilderdsl/common/blocking_job.rb +11 -11
  26. data/lib/rubyjobbuilderdsl/common/build_timeout.rb +23 -23
  27. data/lib/rubyjobbuilderdsl/common/gerrit.rb +53 -53
  28. data/lib/rubyjobbuilderdsl/common/git.rb +76 -76
  29. data/lib/rubyjobbuilderdsl/common/logrotate.rb +24 -24
  30. data/lib/rubyjobbuilderdsl/common/parameter.rb +22 -22
  31. data/lib/rubyjobbuilderdsl/common/password.rb +12 -12
  32. data/lib/rubyjobbuilderdsl/common/pollscm.rb +10 -10
  33. data/lib/rubyjobbuilderdsl/common/scms.rb +18 -18
  34. data/lib/rubyjobbuilderdsl/common/throttle.rb +24 -24
  35. data/lib/rubyjobbuilderdsl/common/timed.rb +10 -10
  36. data/lib/rubyjobbuilderdsl/common/timestamps.rb +6 -6
  37. data/lib/rubyjobbuilderdsl/deployer.rb +95 -95
  38. data/lib/rubyjobbuilderdsl/flow.rb +14 -14
  39. data/lib/rubyjobbuilderdsl/freestyle.rb +65 -65
  40. data/lib/rubyjobbuilderdsl/jenkins_client.rb +203 -203
  41. data/lib/rubyjobbuilderdsl/multijob.rb +24 -24
  42. data/lib/rubyjobbuilderdsl/postbuild.rb +160 -160
  43. data/lib/rubyjobbuilderdsl/postbuild/archive.rb +23 -23
  44. data/lib/rubyjobbuilderdsl/postbuild/chucknorris_publisher.rb +6 -6
  45. data/lib/rubyjobbuilderdsl/postbuild/claim_publisher.rb +6 -6
  46. data/lib/rubyjobbuilderdsl/postbuild/cloverphp_publisher.rb +36 -36
  47. data/lib/rubyjobbuilderdsl/postbuild/cucumber_json_publisher.rb +20 -20
  48. data/lib/rubyjobbuilderdsl/postbuild/email_publisher.rb +23 -23
  49. data/lib/rubyjobbuilderdsl/postbuild/game_publisher.rb +6 -6
  50. data/lib/rubyjobbuilderdsl/postbuild/groovy.rb +10 -10
  51. data/lib/rubyjobbuilderdsl/postbuild/html_publisher.rb +27 -27
  52. data/lib/rubyjobbuilderdsl/postbuild/javadoc_publisher.rb +19 -19
  53. data/lib/rubyjobbuilderdsl/postbuild/logparser.rb +21 -21
  54. data/lib/rubyjobbuilderdsl/postbuild/nunit_publisher.rb +21 -21
  55. data/lib/rubyjobbuilderdsl/postbuild/pmd_publisher.rb +19 -19
  56. data/lib/rubyjobbuilderdsl/postbuild/script.rb +14 -14
  57. data/lib/rubyjobbuilderdsl/postbuild/tap_publisher.rb +44 -44
  58. data/lib/rubyjobbuilderdsl/postbuild/trigger.rb +38 -38
  59. data/lib/rubyjobbuilderdsl/postbuild/xunit_publisher.rb +35 -35
  60. data/lib/rubyjobbuilderdsl/view.rb +14 -14
  61. data/lib/rubyjobbuilderdsl/xml_generator.rb +1 -1
  62. data/rubyjobbuilderdsl.gemspec +2 -2
  63. data/rubyjobbuilderdsl.sublime-project +14 -14
  64. data/run_tests.sh +7 -7
  65. data/sample/hello_mars.rb +27 -27
  66. data/sample/hello_mars.xml +18 -0
  67. data/sample/hello_world-post.xml +40 -0
  68. data/sample/local.ini +4 -4
  69. data/sample/test.xml +21 -0
  70. data/test/test_ant.rb +38 -38
  71. data/test/test_archive.rb +24 -24
  72. data/test/test_artifactory.rb +26 -26
  73. data/test/test_blocking_job.rb +18 -18
  74. data/test/test_chucknorris_publisher.rb +17 -17
  75. data/test/test_claim_publisher.rb +17 -17
  76. data/test/test_cloverphp.rb +33 -33
  77. data/test/test_concurrent.rb +44 -44
  78. data/test/test_copyartifact.rb +45 -45
  79. data/test/test_cucumber_json_publisher.rb +30 -30
  80. data/test/test_default_setting.rb +29 -29
  81. data/test/test_email_publisher.rb +44 -44
  82. data/test/test_flow.rb +19 -19
  83. data/test/test_freestyle.rb +52 -52
  84. data/test/test_game_publisher.rb +17 -17
  85. data/test/test_gerrit.rb +117 -117
  86. data/test/test_git.rb +80 -80
  87. data/test/test_html_publisher.rb +57 -57
  88. data/test/test_inject.rb +23 -23
  89. data/test/test_javadoc.rb +22 -22
  90. data/test/test_logparser.rb +24 -24
  91. data/test/test_logrotate.rb +22 -22
  92. data/test/test_multijob.rb +50 -50
  93. data/test/test_nunit_publisher.rb +20 -20
  94. data/test/test_parameter.rb +44 -44
  95. data/test/test_password.rb +17 -17
  96. data/test/test_pmd.rb +22 -22
  97. data/test/test_pollscm.rb +15 -15
  98. data/test/test_postbuild_groovy.rb +21 -21
  99. data/test/test_postbuild_script.rb +24 -24
  100. data/test/test_postbuild_trigger.rb +170 -170
  101. data/test/test_scms.rb +31 -31
  102. data/test/test_tap_publisher.rb +25 -25
  103. data/test/test_timed.rb +15 -15
  104. data/test/test_timeout.rb +20 -20
  105. data/test/test_timestamps.rb +14 -14
  106. data/test/test_xml_generator.rb +28 -28
  107. data/test/test_xunit_publisher.rb +22 -22
  108. data/test/test_xvfb.rb +35 -35
  109. metadata +11 -10
  110. data/rubyjobbuilderdsl-0.0.3.gem +0 -0
  111. data/sample/Schedule-sample-pipeline.xml +0 -32
data/test/test_git.rb CHANGED
@@ -1,80 +1,80 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlGit < Test::Unit::TestCase
4
- def test_git
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- git do
9
- url 'ssh://bar@gerrit.mycompany.com:29418/foo'
10
- basedir 'foo'
11
- reference_repo '$HOME/foo.git'
12
- branches '$GERRIT_BRANCH'
13
- refspec '$GERRIT_REFSPEC'
14
- choosing_strategy 'gerrit'
15
- git_config_name 'bar'
16
- git_config_email 'bar@mycompany.com'
17
- clean true
18
- end
19
- end
20
-
21
- actual = builder.config_as_xml_node('foo')
22
-
23
- assert_equal '2', actual.xpath("./project/scm[contains(@class,'hudson.plugins.git.GitSCM') and @plugin='git@2.0']/configVersion").text
24
-
25
- { 'name' => 'origin', 'refspec' => '$GERRIT_REFSPEC',
26
- 'url' => 'ssh://bar@gerrit.mycompany.com:29418/foo' }.each do |k, v|
27
- assert_equal v, actual.xpath("./project/scm/userRemoteConfigs/hudson.plugins.git.UserRemoteConfig/#{k}").text, k
28
- end
29
-
30
- assert_equal '$GERRIT_BRANCH', actual.xpath('./project/scm/branches/hudson.plugins.git.BranchSpec/name').text
31
-
32
- assert actual.at('./project/scm/extensions/hudson.plugins.git.extensions.impl.BuildChooserSetting/' \
33
- "buildChooser[contains(@class,'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser')]")
34
-
35
- assert_equal 'foo', actual.xpath('./project/scm/extensions/' \
36
- 'hudson.plugins.git.extensions.impl.RelativeTargetDirectory/relativeTargetDir').text
37
- assert_equal '$HOME/foo.git', actual.xpath('./project/scm/extensions/' \
38
- 'hudson.plugins.git.extensions.impl.CloneOption/reference').text
39
-
40
- { 'name' => 'bar', 'email' => 'bar@mycompany.com' }.each do |k, v|
41
- assert_equal v, actual.xpath("./project/scm/extensions/hudson.plugins.git.extensions.impl.UserIdentity/#{k}").text, k
42
- end
43
-
44
- assert actual.at('./project/scm/extensions/hudson.plugins.git.extensions.impl.CleanCheckout')
45
- end
46
-
47
- def test_filter_by_path
48
- builder = JenkinsJob::Builder.new
49
-
50
- builder.freestyle 'foo' do
51
- git do
52
- url 'ssh://bar@gerrit.mycompany.com:29418/foo/a'
53
- file 'src/a/.*',
54
- 'src/Db/a/.*'
55
- end
56
- end
57
-
58
- actual = builder.config_as_xml_node('foo')
59
-
60
- assert_equal "src/a/.*\nsrc/Db/a/.*", actual.xpath('./project/scm/extensions/' \
61
- 'hudson.plugins.git.extensions.impl.PathRestriction/includedRegions').text
62
- end
63
-
64
- def test_jgit
65
- builder = JenkinsJob::Builder.new
66
-
67
- builder.freestyle 'foo' do
68
- git do
69
- url 'bar@git.mycompany.com:/foo'
70
- jgit
71
- credentials 'bar'
72
- end
73
- end
74
-
75
- actual = builder.config_as_xml_node('foo')
76
-
77
- assert_equal 'jgit', actual.xpath('./project/scm/gitTool').text
78
- assert_equal 'bar', actual.xpath('./project/scm/userRemoteConfigs/hudson.plugins.git.UserRemoteConfig/credentialsId').text
79
- end
80
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlGit < Test::Unit::TestCase
4
+ def test_git
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ git do
9
+ url 'ssh://bar@gerrit.mycompany.com:29418/foo'
10
+ basedir 'foo'
11
+ reference_repo '$HOME/foo.git'
12
+ branches '$GERRIT_BRANCH'
13
+ refspec '$GERRIT_REFSPEC'
14
+ choosing_strategy 'gerrit'
15
+ git_config_name 'bar'
16
+ git_config_email 'bar@mycompany.com'
17
+ clean true
18
+ end
19
+ end
20
+
21
+ actual = builder.config_as_xml_node('foo')
22
+
23
+ assert_equal '2', actual.xpath("./project/scm[contains(@class,'hudson.plugins.git.GitSCM') and @plugin='git@2.0']/configVersion").text
24
+
25
+ { 'name' => 'origin', 'refspec' => '$GERRIT_REFSPEC',
26
+ 'url' => 'ssh://bar@gerrit.mycompany.com:29418/foo' }.each do |k, v|
27
+ assert_equal v, actual.xpath("./project/scm/userRemoteConfigs/hudson.plugins.git.UserRemoteConfig/#{k}").text, k
28
+ end
29
+
30
+ assert_equal '$GERRIT_BRANCH', actual.xpath('./project/scm/branches/hudson.plugins.git.BranchSpec/name').text
31
+
32
+ assert actual.at('./project/scm/extensions/hudson.plugins.git.extensions.impl.BuildChooserSetting/' \
33
+ "buildChooser[contains(@class,'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser')]")
34
+
35
+ assert_equal 'foo', actual.xpath('./project/scm/extensions/' \
36
+ 'hudson.plugins.git.extensions.impl.RelativeTargetDirectory/relativeTargetDir').text
37
+ assert_equal '$HOME/foo.git', actual.xpath('./project/scm/extensions/' \
38
+ 'hudson.plugins.git.extensions.impl.CloneOption/reference').text
39
+
40
+ { 'name' => 'bar', 'email' => 'bar@mycompany.com' }.each do |k, v|
41
+ assert_equal v, actual.xpath("./project/scm/extensions/hudson.plugins.git.extensions.impl.UserIdentity/#{k}").text, k
42
+ end
43
+
44
+ assert actual.at('./project/scm/extensions/hudson.plugins.git.extensions.impl.CleanCheckout')
45
+ end
46
+
47
+ def test_filter_by_path
48
+ builder = JenkinsJob::Builder.new
49
+
50
+ builder.freestyle 'foo' do
51
+ git do
52
+ url 'ssh://bar@gerrit.mycompany.com:29418/foo/a'
53
+ file 'src/a/.*',
54
+ 'src/Db/a/.*'
55
+ end
56
+ end
57
+
58
+ actual = builder.config_as_xml_node('foo')
59
+
60
+ assert_equal "src/a/.*\nsrc/Db/a/.*", actual.xpath('./project/scm/extensions/' \
61
+ 'hudson.plugins.git.extensions.impl.PathRestriction/includedRegions').text
62
+ end
63
+
64
+ def test_jgit
65
+ builder = JenkinsJob::Builder.new
66
+
67
+ builder.freestyle 'foo' do
68
+ git do
69
+ url 'bar@git.mycompany.com:/foo'
70
+ jgit
71
+ credentials 'bar'
72
+ end
73
+ end
74
+
75
+ actual = builder.config_as_xml_node('foo')
76
+
77
+ assert_equal 'jgit', actual.xpath('./project/scm/gitTool').text
78
+ assert_equal 'bar', actual.xpath('./project/scm/userRemoteConfigs/hudson.plugins.git.UserRemoteConfig/credentialsId').text
79
+ end
80
+ end
@@ -1,57 +1,57 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlHtmlPublisher < Test::Unit::TestCase
4
- def test_postbuild_html_publisher
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- postbuild do
9
- publish_html 'Test Report' do
10
- dir '$BUILD_NUMBER\\Reports'
11
- file 'test-report.html'
12
- keep_all false
13
- allow_missing true
14
- end
15
- end
16
- end
17
-
18
- actual = builder.config_as_xml_node('foo')
19
-
20
- {
21
- 'reportName' => 'Test Report',
22
- 'reportDir' => '$BUILD_NUMBER\Reports',
23
- 'reportFiles' => 'test-report.html',
24
- 'keepAll' => 'false',
25
- 'allowMissing' => 'true',
26
- 'wrapperName' => 'htmlpublisher-wrapper.html'
27
- }.each do |k, v|
28
- assert_equal v, actual.xpath('./project/publishers/htmlpublisher.HtmlPublisher/' \
29
- "reportTargets/htmlpublisher.HtmlPublisherTarget/#{k}").text, k
30
- end
31
- end
32
-
33
- def test_postbuild_multiple_html_publisher
34
- builder = JenkinsJob::Builder.new
35
-
36
- builder.freestyle 'foo' do
37
- postbuild do
38
- publish_html 'Test Report' do
39
- dir '$BUILD_NUMBER\\Reports'
40
- file 'test-report.html'
41
- keep_all false
42
- allow_missing true
43
- end
44
- publish_html 'Test Report 2' do
45
- dir '$BUILD_NUMBER\\Reports'
46
- file 'test-report-2.html'
47
- keep_all false
48
- allow_missing true
49
- end
50
- end
51
- end
52
-
53
- actual = builder.config_as_xml_node('foo')
54
-
55
- assert_equal 2, actual.xpath('count(./project/publishers/htmlpublisher.HtmlPublisher)').to_i
56
- end
57
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlHtmlPublisher < Test::Unit::TestCase
4
+ def test_postbuild_html_publisher
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ postbuild do
9
+ publish_html 'Test Report' do
10
+ dir '$BUILD_NUMBER\\Reports'
11
+ file 'test-report.html'
12
+ keep_all false
13
+ allow_missing true
14
+ end
15
+ end
16
+ end
17
+
18
+ actual = builder.config_as_xml_node('foo')
19
+
20
+ {
21
+ 'reportName' => 'Test Report',
22
+ 'reportDir' => '$BUILD_NUMBER\Reports',
23
+ 'reportFiles' => 'test-report.html',
24
+ 'keepAll' => 'false',
25
+ 'allowMissing' => 'true',
26
+ 'wrapperName' => 'htmlpublisher-wrapper.html'
27
+ }.each do |k, v|
28
+ assert_equal v, actual.xpath('./project/publishers/htmlpublisher.HtmlPublisher/' \
29
+ "reportTargets/htmlpublisher.HtmlPublisherTarget/#{k}").text, k
30
+ end
31
+ end
32
+
33
+ def test_postbuild_multiple_html_publisher
34
+ builder = JenkinsJob::Builder.new
35
+
36
+ builder.freestyle 'foo' do
37
+ postbuild do
38
+ publish_html 'Test Report' do
39
+ dir '$BUILD_NUMBER\\Reports'
40
+ file 'test-report.html'
41
+ keep_all false
42
+ allow_missing true
43
+ end
44
+ publish_html 'Test Report 2' do
45
+ dir '$BUILD_NUMBER\\Reports'
46
+ file 'test-report-2.html'
47
+ keep_all false
48
+ allow_missing true
49
+ end
50
+ end
51
+ end
52
+
53
+ actual = builder.config_as_xml_node('foo')
54
+
55
+ assert_equal 2, actual.xpath('count(./project/publishers/htmlpublisher.HtmlPublisher)').to_i
56
+ end
57
+ end
data/test/test_inject.rb CHANGED
@@ -1,23 +1,23 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlInject < Test::Unit::TestCase
4
- def test_freestyle_inject
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- inject_env do
9
- properties_content 'EXAMPLE1=foo'
10
- properties_content 'EXAMPLE2=foo'
11
- properties_file 'env.prop'
12
- end
13
- end
14
-
15
- actual = builder.config_as_xml_node('foo')
16
- { 'EnvInjectBuilder/info/propertiesFilePath' => 'env.prop',
17
- 'EnvInjectBuilder/info/propertiesContent' => 'EXAMPLE2=foo',
18
- }.each do |k, v|
19
- assert_equal v, actual.xpath('./project/builders/' \
20
- "#{k}").text, k
21
- end
22
- end
23
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlInject < Test::Unit::TestCase
4
+ def test_freestyle_inject
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ inject_env do
9
+ properties_content 'EXAMPLE1=foo'
10
+ properties_content 'EXAMPLE2=foo'
11
+ properties_file 'env.prop'
12
+ end
13
+ end
14
+
15
+ actual = builder.config_as_xml_node('foo')
16
+ { 'EnvInjectBuilder/info/propertiesFilePath' => 'env.prop',
17
+ 'EnvInjectBuilder/info/propertiesContent' => 'EXAMPLE2=foo',
18
+ }.each do |k, v|
19
+ assert_equal v, actual.xpath('./project/builders/' \
20
+ "#{k}").text, k
21
+ end
22
+ end
23
+ end
data/test/test_javadoc.rb CHANGED
@@ -1,22 +1,22 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlAnt < Test::Unit::TestCase
4
- def test_javadoc
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- postbuild do
9
- publish_javadoc do
10
- doc_dir 'build/doc'
11
- keep_all false
12
- end
13
- end
14
- end
15
-
16
- actual = builder.config_as_xml_node('foo')
17
- { 'keepAll' => 'false',
18
- 'javadocDir' => 'build/doc' }.each do |k, v|
19
- assert_equal v, actual.xpath("./project/publishers/hudson.tasks.JavadocArchiver/#{k}").text, k
20
- end
21
- end
22
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlAnt < Test::Unit::TestCase
4
+ def test_javadoc
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ postbuild do
9
+ publish_javadoc do
10
+ doc_dir 'build/doc'
11
+ keep_all false
12
+ end
13
+ end
14
+ end
15
+
16
+ actual = builder.config_as_xml_node('foo')
17
+ { 'keepAll' => 'false',
18
+ 'javadocDir' => 'build/doc' }.each do |k, v|
19
+ assert_equal v, actual.xpath("./project/publishers/hudson.tasks.JavadocArchiver/#{k}").text, k
20
+ end
21
+ end
22
+ end
@@ -1,24 +1,24 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlLogparser < Test::Unit::TestCase
4
- def test_postbuild_logparser
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- postbuild do
9
- logparser '/var/lib/jenkins/build_parsing_rules' do
10
- fail_on_error
11
- end
12
- end
13
- end
14
-
15
- actual = builder.config_as_xml_node('foo')
16
-
17
- { 'unstableOnWarning' => 'false',
18
- 'failBuildOnError' => 'true',
19
- 'parsingRulesPath' => '/var/lib/jenkins/build_parsing_rules'
20
- }.each do |k, v|
21
- assert_equal v, actual.xpath("./project/publishers/hudson.plugins.logparser.LogParserPublisher/#{k}").text, k
22
- end
23
- end
24
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlLogparser < Test::Unit::TestCase
4
+ def test_postbuild_logparser
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ postbuild do
9
+ logparser '/var/lib/jenkins/build_parsing_rules' do
10
+ fail_on_error
11
+ end
12
+ end
13
+ end
14
+
15
+ actual = builder.config_as_xml_node('foo')
16
+
17
+ { 'unstableOnWarning' => 'false',
18
+ 'failBuildOnError' => 'true',
19
+ 'parsingRulesPath' => '/var/lib/jenkins/build_parsing_rules'
20
+ }.each do |k, v|
21
+ assert_equal v, actual.xpath("./project/publishers/hudson.plugins.logparser.LogParserPublisher/#{k}").text, k
22
+ end
23
+ end
24
+ end
@@ -1,22 +1,22 @@
1
- require_relative './test_xml_generator'
2
-
3
- class TestXmlLogrotate < Test::Unit::TestCase
4
- def test_logrotate
5
- builder = JenkinsJob::Builder.new
6
-
7
- builder.freestyle 'foo' do
8
- logrotate do
9
- days_to_keep 14
10
- num_to_keep(-1)
11
- artifact_days_to_keep 2
12
- artifact_num_to_keep(-1)
13
- end
14
- end
15
-
16
- actual = builder.config_as_xml_node('foo')
17
-
18
- { 'daysToKeep' => '14', 'numToKeep' => '-1', 'artifactDaysToKeep' => '2', 'artifactNumToKeep' => '-1' }.each do |k, v|
19
- assert_equal v, actual.xpath("./project/logRotator/#{k}").text, k
20
- end
21
- end
22
- end
1
+ require_relative './test_xml_generator'
2
+
3
+ class TestXmlLogrotate < Test::Unit::TestCase
4
+ def test_logrotate
5
+ builder = JenkinsJob::Builder.new
6
+
7
+ builder.freestyle 'foo' do
8
+ logrotate do
9
+ days_to_keep 14
10
+ num_to_keep(-1)
11
+ artifact_days_to_keep 2
12
+ artifact_num_to_keep(-1)
13
+ end
14
+ end
15
+
16
+ actual = builder.config_as_xml_node('foo')
17
+
18
+ { 'daysToKeep' => '14', 'numToKeep' => '-1', 'artifactDaysToKeep' => '2', 'artifactNumToKeep' => '-1' }.each do |k, v|
19
+ assert_equal v, actual.xpath("./project/logRotator/#{k}").text, k
20
+ end
21
+ end
22
+ end