BuildMaster 0.9.1 → 1.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 (174) hide show
  1. data/bin/svnfix.rb +3 -0
  2. data/lib/buildmaster/ci/server.rb +55 -0
  3. data/lib/buildmaster/common.rb +3 -0
  4. data/lib/buildmaster/common/properties.rb +28 -0
  5. data/lib/buildmaster/{tree_to_object.rb → common/tree_to_object.rb} +0 -0
  6. data/lib/buildmaster/cotta.rb +1 -1
  7. data/lib/buildmaster/cotta/command_error.rb +6 -1
  8. data/lib/buildmaster/cotta/command_interface.rb +44 -0
  9. data/lib/buildmaster/cotta/command_runner.rb +39 -0
  10. data/lib/buildmaster/cotta/cotta.rb +40 -3
  11. data/lib/buildmaster/cotta/cotta_dir.rb +28 -7
  12. data/lib/buildmaster/cotta/cotta_file.rb +14 -2
  13. data/lib/buildmaster/cotta/cotta_pathname.rb +9 -0
  14. data/lib/buildmaster/cotta/in_memory_system.rb +20 -9
  15. data/lib/buildmaster/cotta/physical_system.rb +4 -8
  16. data/lib/buildmaster/project.rb +10 -0
  17. data/lib/buildmaster/{ant_driver.rb → project/ant_driver.rb} +0 -0
  18. data/lib/buildmaster/project/build.rb +3 -0
  19. data/lib/buildmaster/{build_number_file.rb → project/build_number_file.rb} +4 -0
  20. data/lib/buildmaster/project/ci.rb +3 -0
  21. data/lib/buildmaster/{cvs_driver.rb → project/cvs_driver.rb} +0 -0
  22. data/lib/buildmaster/project/ftp_driver.rb +64 -0
  23. data/lib/buildmaster/{java_manifest.rb → project/java_manifest.rb} +0 -0
  24. data/lib/buildmaster/project/pscp_driver.rb +17 -0
  25. data/lib/buildmaster/project/release.rb +67 -0
  26. data/lib/buildmaster/project/ruby_forge_project.rb +26 -0
  27. data/lib/buildmaster/{run_ant.rb → project/run_ant.rb} +0 -0
  28. data/lib/buildmaster/project/server_manager.rb +64 -0
  29. data/lib/buildmaster/project/svn_admin_driver.rb +20 -0
  30. data/lib/buildmaster/project/svn_driver.rb +94 -0
  31. data/lib/buildmaster/project/svn_helper.rb +113 -0
  32. data/lib/buildmaster/project/svn_status_info.rb +54 -0
  33. data/lib/buildmaster/{try.rb → project/try.rb} +0 -0
  34. data/lib/buildmaster/project/version_number_file.rb +45 -0
  35. data/lib/buildmaster/{windows → project/windows}/iis_driver.rb +4 -4
  36. data/lib/buildmaster/{windows → project/windows}/sql_server_driver.rb +0 -0
  37. data/lib/buildmaster/site.rb +5 -0
  38. data/lib/buildmaster/site/about_handler.rb +43 -0
  39. data/lib/buildmaster/site/content_engine_repository.rb +83 -0
  40. data/lib/buildmaster/site/element_processor_by_name.rb +18 -0
  41. data/lib/buildmaster/site/file_processor.rb +59 -0
  42. data/lib/buildmaster/site/site.rb +29 -6
  43. data/lib/buildmaster/site/site_server.rb +56 -0
  44. data/lib/buildmaster/{site_spec.rb → site/site_spec.rb} +63 -38
  45. data/lib/buildmaster/{site_tester.rb → site/site_tester.rb} +0 -0
  46. data/lib/buildmaster/site/source_content.rb +12 -0
  47. data/lib/buildmaster/{source_file_handler.rb → site/source_file_handler.rb} +13 -27
  48. data/lib/buildmaster/site/template_builder.rb +4 -0
  49. data/lib/buildmaster/site/template_error.rb +18 -0
  50. data/lib/buildmaster/{template_runner.rb → site/template_runner.rb} +6 -16
  51. data/lib/buildmaster/{templatelets.rb → site/templatelets.rb} +3 -1
  52. data/lib/buildmaster/site/templatelets/attribute.rb +21 -0
  53. data/lib/buildmaster/site/templatelets/code.rb +82 -0
  54. data/lib/buildmaster/{templatelets → site/templatelets}/each.rb +7 -5
  55. data/lib/buildmaster/{templatelets → site/templatelets}/href.rb +1 -1
  56. data/lib/buildmaster/{templatelets → site/templatelets}/include.rb +0 -0
  57. data/lib/buildmaster/{templatelets → site/templatelets}/link.rb +2 -3
  58. data/lib/buildmaster/{templatelets → site/templatelets}/text.rb +1 -1
  59. data/lib/buildmaster/{templatelets → site/templatelets}/when.rb +4 -7
  60. data/lib/buildmaster/site/templates/buildmaster/content/border_bottom.gif +0 -0
  61. data/lib/buildmaster/site/templates/buildmaster/content/buildmaster.css +370 -0
  62. data/lib/buildmaster/site/templates/buildmaster/content/logo.gif +0 -0
  63. data/lib/buildmaster/site/templates/buildmaster/content/news-rss2.xml +4 -0
  64. data/lib/buildmaster/site/templates/buildmaster/content/print.css +65 -0
  65. data/lib/buildmaster/site/templates/buildmaster/content/ruby.css +14 -0
  66. data/lib/buildmaster/site/templates/buildmaster/template.html +121 -0
  67. data/lib/buildmaster/site/templates/cotta/content/border_bottom.gif +0 -0
  68. data/lib/buildmaster/site/templates/cotta/content/cotta.css +363 -0
  69. data/lib/buildmaster/site/templates/cotta/content/cotta.gif +0 -0
  70. data/lib/buildmaster/site/templates/cotta/content/news-rss2.xml +2 -0
  71. data/lib/buildmaster/site/templates/cotta/template.html +106 -0
  72. data/lib/buildmaster/site/xtemplate.rb +26 -0
  73. data/lib/buildmaster/version +1 -0
  74. data/test/buildmaster/common/tc_properties.rb +24 -0
  75. data/test/buildmaster/{tc_tree_to_object.rb → common/tc_tree_to_object.rb} +18 -18
  76. data/test/buildmaster/cotta/cotta_specifications.rb +88 -64
  77. data/test/buildmaster/cotta/physical_system_stub.rb +3 -3
  78. data/test/buildmaster/cotta/system_file_specifications.rb +38 -47
  79. data/test/buildmaster/cotta/tc_command_interface.rb +46 -0
  80. data/test/buildmaster/cotta/tc_command_runner.rb +28 -0
  81. data/test/buildmaster/cotta/tc_cotta.rb +35 -9
  82. data/test/buildmaster/cotta/tc_cotta_dir_in_memory.rb +10 -5
  83. data/test/buildmaster/cotta/tc_cotta_file_in_memory.rb +3 -3
  84. data/test/buildmaster/cotta/tc_in_memory_system.rb +7 -2
  85. data/test/buildmaster/cotta/tc_pathname.rb +22 -0
  86. data/test/buildmaster/cotta/tc_physical_system.rb +12 -2
  87. data/test/buildmaster/{build.xml → project/build.xml} +0 -0
  88. data/test/buildmaster/{manifest.mf → project/manifest.mf} +0 -0
  89. data/test/buildmaster/{tc_ant_driver.rb → project/tc_ant_driver.rb} +3 -3
  90. data/test/buildmaster/{tc_build_number_file.rb → project/tc_build_number_file.rb} +7 -7
  91. data/test/buildmaster/{tc_cvs_driver.rb → project/tc_cvs_driver.rb} +14 -14
  92. data/test/buildmaster/{tc_java_manifest.rb → project/tc_java_manifest.rb} +7 -7
  93. data/test/buildmaster/project/tc_release.rb +61 -0
  94. data/test/buildmaster/project/tc_server_manager.rb +70 -0
  95. data/test/buildmaster/project/tc_svn_driver.rb +104 -0
  96. data/test/buildmaster/project/tc_svn_status_info.rb +37 -0
  97. data/test/buildmaster/project/tc_version_number_file.rb +46 -0
  98. data/test/buildmaster/{windows → project/windows}/tc_iis_driver.rb +5 -4
  99. data/test/buildmaster/{windows → project/windows}/tc_sql_server_driver.rb +4 -4
  100. data/test/buildmaster/site/content/tc_content_engine_repository.rb +63 -0
  101. data/test/buildmaster/site/tc_element_processor_by_name.rb +29 -0
  102. data/test/buildmaster/site/tc_file_processor.rb +141 -0
  103. data/test/buildmaster/site/tc_site.rb +42 -11
  104. data/test/buildmaster/site/tc_site_server.rb +43 -0
  105. data/test/buildmaster/{tc_site_spec.rb → site/tc_site_spec.rb} +9 -9
  106. data/test/buildmaster/{tc_source_file_handler.rb → site/tc_source_file_handler.rb} +10 -9
  107. data/test/buildmaster/site/tc_template_builder.rb +23 -23
  108. data/test/buildmaster/site/tc_template_error.rb +15 -0
  109. data/test/buildmaster/{tc_template_runner.rb → site/tc_template_runner.rb} +22 -17
  110. data/test/buildmaster/site/tc_templatelets.rb +37 -0
  111. data/test/buildmaster/{tc_xtemplate.rb → site/tc_xtemplate.rb} +14 -15
  112. data/test/buildmaster/{template.xhtml → site/template.xhtml} +0 -0
  113. data/test/buildmaster/{templatelets → site/templatelets}/common_templatelet_test.rb +11 -7
  114. data/test/buildmaster/{templatelets → site/templatelets}/tc_attribute.rb +14 -10
  115. data/test/buildmaster/site/templatelets/tc_code.rb +132 -0
  116. data/test/buildmaster/{templatelets → site/templatelets}/tc_each.rb +25 -12
  117. data/test/buildmaster/{templatelets → site/templatelets}/tc_href.rb +6 -8
  118. data/test/buildmaster/{templatelets → site/templatelets}/tc_include.rb +3 -12
  119. data/test/buildmaster/{templatelets → site/templatelets}/tc_link.rb +11 -18
  120. data/test/buildmaster/{templatelets → site/templatelets}/tc_text.rb +2 -9
  121. data/test/buildmaster/{templatelets → site/templatelets}/tc_when.rb +8 -15
  122. data/test/manual/bms.rb +10 -0
  123. data/test/tmp/svn_test/repository/README.txt +5 -0
  124. data/test/tmp/svn_test/repository/conf/authz +21 -0
  125. data/test/tmp/svn_test/repository/conf/passwd +8 -0
  126. data/test/tmp/svn_test/repository/conf/svnserve.conf +30 -0
  127. data/test/tmp/svn_test/repository/db/current +1 -0
  128. data/test/tmp/svn_test/repository/db/format +1 -0
  129. data/test/tmp/svn_test/repository/db/fs-type +1 -0
  130. data/test/tmp/svn_test/repository/db/revprops/0 +5 -0
  131. data/test/tmp/svn_test/repository/db/revprops/1 +13 -0
  132. data/test/tmp/svn_test/repository/db/revprops/2 +13 -0
  133. data/test/tmp/svn_test/repository/db/revprops/3 +13 -0
  134. data/test/tmp/svn_test/repository/db/revprops/4 +13 -0
  135. data/test/tmp/svn_test/repository/db/revs/0 +11 -0
  136. data/test/tmp/svn_test/repository/db/revs/1 +25 -0
  137. data/test/tmp/svn_test/repository/db/revs/2 +29 -0
  138. data/test/tmp/svn_test/repository/db/revs/3 +33 -0
  139. data/test/tmp/svn_test/repository/db/revs/4 +0 -0
  140. data/test/tmp/svn_test/repository/db/uuid +1 -0
  141. data/test/tmp/svn_test/repository/db/write-lock +0 -0
  142. data/test/tmp/svn_test/repository/format +1 -0
  143. data/test/tmp/svn_test/repository/hooks/post-commit.tmpl +51 -0
  144. data/test/tmp/svn_test/repository/hooks/post-lock.tmpl +44 -0
  145. data/test/tmp/svn_test/repository/hooks/post-revprop-change.tmpl +56 -0
  146. data/test/tmp/svn_test/repository/hooks/post-unlock.tmpl +42 -0
  147. data/test/tmp/svn_test/repository/hooks/pre-commit.tmpl +70 -0
  148. data/test/tmp/svn_test/repository/hooks/pre-lock.tmpl +64 -0
  149. data/test/tmp/svn_test/repository/hooks/pre-revprop-change.tmpl +66 -0
  150. data/test/tmp/svn_test/repository/hooks/pre-unlock.tmpl +60 -0
  151. data/test/tmp/svn_test/repository/hooks/start-commit.tmpl +54 -0
  152. data/test/tmp/svn_test/repository/locks/db-logs.lock +3 -0
  153. data/test/tmp/svn_test/repository/locks/db.lock +3 -0
  154. data/test/tmp/svn_test/second/test.txt +1 -0
  155. data/test/tmp/svn_test/workdir/test.txt +1 -0
  156. data/test/ts_buildmaster.rb +0 -1
  157. metadata +168 -69
  158. data/lib/buildmaster.rb +0 -10
  159. data/lib/buildmaster/build_file.rb +0 -11
  160. data/lib/buildmaster/buildnumber +0 -1
  161. data/lib/buildmaster/file_processor.rb +0 -138
  162. data/lib/buildmaster/site_server.rb +0 -33
  163. data/lib/buildmaster/source_content.rb +0 -11
  164. data/lib/buildmaster/svn_driver.rb +0 -78
  165. data/lib/buildmaster/template_error.rb +0 -8
  166. data/lib/buildmaster/templatelets/attribute.rb +0 -16
  167. data/lib/buildmaster/xtemplate.rb +0 -27
  168. data/lib/mock.rb +0 -3
  169. data/lib/mock/mock_base.rb +0 -24
  170. data/test/buildmaster/tc_file_processor.rb +0 -125
  171. data/test/buildmaster/tc_svn_driver.rb +0 -81
  172. data/test/tmp/output/index.html +0 -8
  173. data/test/tmp/output/markdown.html +0 -8
  174. data/test/tmp/output/textile.html +0 -8
@@ -2,10 +2,6 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
4
 
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
- require 'buildmaster/template_runner'
8
-
9
5
  module BuildMaster
10
6
 
11
7
  class MySite < SiteSpec
@@ -39,12 +35,30 @@ context 'EachTest' do
39
35
  </each>
40
36
  CONTENT
41
37
  target = create_element('test')
42
- template = REXML::XPath.first(REXML::Document.new(template_content), '/each')
38
+ template = create_template_element(template_content, '/each')
39
+ site = MySite.new(@site_spec, @cotta)
40
+ each_processor = Each.new(site)
41
+ each_processor.process(target, template, SourceContent.new('doc/doc.html', nil, nil))
42
+ REXML::XPath.first(target, 'div').attributes['class'].should == 'NewsItem'
43
+ REXML::XPath.match(target, 'div').size.should == 2
44
+ end
45
+
46
+ specify 'handles the case where there are not enough items' do
47
+ template_content = <<CONTENT
48
+ <each source="rss" select="/rss/item" count="4">
49
+ <div class="NewsItem">
50
+ <p class="Title"><include elements="./title/text()"/></p>
51
+ <p class="Date"><include elements="./pubDate/text()"/></p>
52
+ </div>
53
+ </each>
54
+ CONTENT
55
+ target = create_element('test')
56
+ template = create_template_element(template_content, '/each')
43
57
  site = MySite.new(@site_spec, @cotta)
44
58
  each_processor = Each.new(site)
45
- each_processor.process(target, template, SourceContent.new('doc/doc.html', nil))
46
- REXML::XPath.first(target, 'div').attributes['class'].should_equal 'NewsItem'
47
- REXML::XPath.match(target, 'div').size.should_equal 2
59
+ each_processor.process(target, template, SourceContent.new('doc/doc.html', nil, nil))
60
+ REXML::XPath.first(target, 'div').attributes['class'].should == 'NewsItem'
61
+ REXML::XPath.match(target, 'div').size.should == 2
48
62
  end
49
63
 
50
64
  def on_line_test_rss_uri_need_start_a_server
@@ -60,10 +74,9 @@ CONTENT
60
74
  template = REXML::XPath.first(REXML::Document.new(template_content), '/each')
61
75
  site = MySite.new
62
76
  each_processor = Each.new(site)
63
- each_processor.process(target, template, SourceContent.new('doc/doc.html', nil))
64
- REXML::XPath.first(target, 'div').attributes['class'].should_equal 'NewsItem'
65
- REXML::XPath.match(target, 'div').size.should_equal 2
66
-
77
+ each_processor.process(target, template, SourceContent.new('doc/doc.html', nil, nil))
78
+ REXML::XPath.first(target, 'div').attributes['class'].should == 'NewsItem'
79
+ REXML::XPath.match(target, 'div').size.should == 2
67
80
  end
68
81
  end
69
82
 
@@ -2,8 +2,6 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
4
 
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
5
  module BuildMaster
8
6
  context 'HrefTest' do
9
7
  include HelperMethods
@@ -15,41 +13,41 @@ context 'HrefTest' do
15
13
  end
16
14
 
17
15
  def source(path)
18
- SourceContent.new(Pathname.new(path), nil)
16
+ SourceContent.new(Pathname.new(path), nil, nil)
19
17
  end
20
18
 
21
19
  specify 'should_populate_href_attribute_with_full_url' do
22
20
  expected_url = 'http://www.rubyforge.org'
23
21
  @template_element.attributes['url']=expected_url
24
22
  @href.process(@target_element, @template_element, source('index.html'))
25
- @target_element.attributes['href'].should_equal expected_url
23
+ @target_element.attributes['href'].should == expected_url
26
24
  end
27
25
 
28
26
  specify 'should_populate_href_attribute_with_relative_path' do
29
27
  @template_element.attributes['url']='doc/doc.html'
30
28
  @href.process(@target_element, @template_element, source('download/index.html'))
31
- @target_element.attributes['href'].should_equal '../doc/doc.html'
29
+ @target_element.attributes['href'].should == '../doc/doc.html'
32
30
  end
33
31
 
34
32
  specify 'should_support_image_tag_by_generating_src_attribute' do
35
33
  @template_element.attributes['url']='doc/doc.gif'
36
34
  @target_element = create_element('img')
37
35
  @href.process(@target_element, @template_element, source('download/download.html'))
38
- @target_element.attributes['src'].should_equal '../doc/doc.gif'
36
+ @target_element.attributes['src'].should == '../doc/doc.gif'
39
37
  end
40
38
 
41
39
  specify 'should_handle_external_links' do
42
40
  @template_element.attributes['url'] = 'http://www.google.com'
43
41
  @target_element = create_element('img')
44
42
  @href.process(@target_element, @template_element, source('download/download.html'))
45
- @target_element.attributes['src'].should_equal 'http://www.google.com'
43
+ @target_element.attributes['src'].should == 'http://www.google.com'
46
44
  end
47
45
 
48
46
  specify 'should_handle_absolute_path' do
49
47
  @template_element.attributes['url'] = '/doc.html'
50
48
  @target_element = create_element('img')
51
49
  @href.process(@target_element, @template_element, source('download/download.html'))
52
- @target_element.attributes['src'].should_equal '../doc.html'
50
+ @target_element.attributes['src'].should == '../doc.html'
53
51
  end
54
52
 
55
53
  end
@@ -1,15 +1,6 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
-
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
- require 'rexml/document'
8
- require 'rexml/element'
9
- require 'buildmaster/site_spec'
10
- require 'buildmaster/source_content'
11
- require 'buildmaster/templatelets/include'
12
-
13
4
  module BuildMaster
14
5
 
15
6
  context 'IncludeTest' do
@@ -30,11 +21,11 @@ context 'IncludeTest' do
30
21
  <two></two>
31
22
  </item>
32
23
  CONTENT
33
- source = SourceContent.new(Pathname.new('doc/index.html'), REXML::Document.new(source_content))
24
+ source = SourceContent.new(Pathname.new('doc/index.html'), REXML::Document.new(source_content), nil)
34
25
  include = Include.new(SiteSpec.new)
35
26
  include.process(target, template, source)
36
- REXML::XPath.first(target, 'one').text.should_equal 'test'
37
- target.text.strip!.should_equal 'text'
27
+ REXML::XPath.first(target, 'one').text.should == 'test'
28
+ target.text.strip!.should == 'text'
38
29
  end
39
30
  end
40
31
  end
@@ -2,13 +2,6 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
4
 
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
- require 'rexml/document'
8
- require 'rexml/xpath'
9
- require 'buildmaster/site_spec'
10
- require 'buildmaster/source_content'
11
-
12
5
  module BuildMaster
13
6
  context 'LinkTest' do
14
7
  include HelperMethods
@@ -29,10 +22,10 @@ CONTENT
29
22
  template = REXML::XPath.first(template_document, '/root/link')
30
23
  source = create_element('source')
31
24
  link = Link.new(SiteSpec.new)
32
- link.process(target, template, SourceContent.new(Pathname.new('doc/doc.html'), source))
25
+ link.process(target, template, SourceContent.new(Pathname.new('doc/doc.html'), source, nil))
33
26
  actual = REXML::XPath.first(target, 'a')
34
- actual.attributes['href'].should_equal '../content/path.html'
35
- actual.text.should_equal 'text'
27
+ actual.attributes['href'].should == '../content/path.html'
28
+ actual.text.should == 'text'
36
29
  end
37
30
 
38
31
  specify 'should_copy_all_attributes' do
@@ -43,10 +36,10 @@ CONTENT
43
36
  template.attributes['attribute2'] = 'value2'
44
37
  source = create_element('source')
45
38
  link = Link.new(SiteSpec.new)
46
- link.process(target, template, SourceContent.new(Pathname.new('doc/doc.html'), source))
39
+ link.process(target, template, SourceContent.new(Pathname.new('doc/doc.html'), source, nil))
47
40
  actual = REXML::XPath.first(target, 'a')
48
- actual.attributes['attribute1'].should_equal 'value1'
49
- actual.attributes['attribute2'].should_equal 'value2'
41
+ actual.attributes['attribute1'].should == 'value1'
42
+ actual.attributes['attribute2'].should == 'value2'
50
43
  end
51
44
 
52
45
  specify 'should_handle_absolute_path' do
@@ -55,9 +48,9 @@ CONTENT
55
48
  template.attributes['href'] = '/content/path.html'
56
49
  source = create_element('source')
57
50
  link = Link.new(SiteSpec.new)
58
- link.process(target, template, SourceContent.new(Pathname.new('doc/iste/doc.html'), source))
51
+ link.process(target, template, SourceContent.new(Pathname.new('doc/iste/doc.html'), source, nil))
59
52
  actual = REXML::XPath.first(target, 'a')
60
- actual.attributes['href'].should_equal '../../content/path.html'
53
+ actual.attributes['href'].should == '../../content/path.html'
61
54
  end
62
55
 
63
56
  specify 'should_generate_div_with_current_class_attribute_if_link_is_on_current_page' do
@@ -66,10 +59,10 @@ CONTENT
66
59
  template.attributes['href'] = '/content/path.html'
67
60
  source = create_element('source')
68
61
  link = Link.new(SiteSpec.new)
69
- link.process(target, template, SourceContent.new(Pathname.new('content/path.html'), source))
62
+ link.process(target, template, SourceContent.new(Pathname.new('content/path.html'), source, nil))
70
63
  actual = REXML::XPath.first(target, 'div')
71
- actual.attributes['href'].should_equal nil
72
- actual.attributes['class'].should_equal 'current'
64
+ actual.attributes['href'].should == nil
65
+ actual.attributes['class'].should == 'current'
73
66
  end
74
67
 
75
68
  end
@@ -2,13 +2,6 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
4
 
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
- require 'rexml/document'
8
- require 'rexml/xpath'
9
- require 'buildmaster/site_spec'
10
- require 'buildmaster/source_content'
11
-
12
5
  module BuildMaster
13
6
  context 'TextTest' do
14
7
  include HelperMethods
@@ -22,7 +15,7 @@ context 'TextTest' do
22
15
  template.attributes['property'] = 'property'
23
16
  text = Text.new({'property' => 'text'})
24
17
  text.process(target, template, nil)
25
- target.text.should_equal 'text'
18
+ target.text.should == 'text'
26
19
  end
27
20
 
28
21
  specify 'should_throw_exception_if_property_not_set' do
@@ -34,7 +27,7 @@ context 'TextTest' do
34
27
  text.process(target, template, nil)
35
28
  fail('TemplateError should have been thrown')
36
29
  rescue TemplateError => exception
37
- exception.message.include?('one').should_equal true
30
+ exception.message.include?('one').should == true
38
31
  end
39
32
  end
40
33
  end
@@ -2,13 +2,6 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'common_templatelet_test'
4
4
 
5
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
-
7
- require 'rexml/document'
8
- require 'rexml/xpath'
9
- require 'buildmaster/site_spec'
10
- require 'buildmaster/templatelets'
11
-
12
5
  module BuildMaster
13
6
  context 'WhenTest' do
14
7
  include HelperMethods
@@ -24,12 +17,14 @@ context 'WhenTest' do
24
17
  <h1>Header</h1>
25
18
  </when>
26
19
  CONTENT
20
+ sitespec_mock = mock('SiteSpec')
21
+ sitespec_mock.should_receive(:load_element_processor).once.with(:no_args).and_return(nil)
27
22
  template_document = REXML::Document.new(template_content)
28
23
  template = REXML::XPath.first(template_document, '/when')
29
- when_processor = When.new(self, self)
24
+ when_processor = When.new(sitespec_mock, self)
30
25
  when_processor.process(target, template, self)
31
26
  actual = REXML::XPath.first(target, 'h1')
32
- actual.text.should_equal 'Header'
27
+ actual.text.should == 'Header'
33
28
  end
34
29
 
35
30
  specify 'should_not_process_child_when_evaluated_false' do
@@ -39,11 +34,13 @@ CONTENT
39
34
  <h1>Header</h1>
40
35
  </when>
41
36
  CONTENT
37
+ sitespec_mock = mock('SiteSpec')
38
+
42
39
  template_document = REXML::Document.new(template_content)
43
40
  template = REXML::XPath.first(template_document, '/when')
44
- when_processor = When.new(self, self)
41
+ when_processor = When.new(sitespec_mock, self)
45
42
  when_processor.process(target, template, self)
46
- target.size.should_equal 0
43
+ target.size.should == 0
47
44
  end
48
45
 
49
46
  def path
@@ -57,9 +54,5 @@ CONTENT
57
54
  def expression_for_false(path)
58
55
  return 'one word two' =~ /nomatch/
59
56
  end
60
-
61
- def load_templatelets
62
- return Hash.new
63
- end
64
57
  end
65
58
  end
@@ -0,0 +1,10 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), '..', '..', 'buildmaster')
2
+
3
+ require 'cotta'
4
+ require 'ci'
5
+
6
+ dir = BuildMaster::Cotta.file(__FILE__).parent.dir('../../tmp/bms')
7
+ dir.mkdirs
8
+
9
+ server = BuildMaster::CI::Server.new
10
+ server.serve
@@ -0,0 +1,5 @@
1
+ This is a Subversion repository; use the 'svnadmin' tool to examine
2
+ it. Do not add, delete, or modify files here unless you know how
3
+ to avoid corrupting the repository.
4
+
5
+ Visit http://subversion.tigris.org/ for more information.
@@ -0,0 +1,21 @@
1
+ ### This file is an example authorization file for svnserve.
2
+ ### Its format is identical to that of mod_authz_svn authorization
3
+ ### files.
4
+ ### As shown below each section defines authorizations for the path and
5
+ ### (optional) repository specified by the section name.
6
+ ### The authorizations follow. An authorization line can refer to a
7
+ ### single user, to a group of users defined in a special [groups]
8
+ ### section, or to anyone using the '*' wildcard. Each definition can
9
+ ### grant read ('r') access, read-write ('rw') access, or no access
10
+ ### ('').
11
+
12
+ [groups]
13
+ # harry_and_sally = harry,sally
14
+
15
+ # [/foo/bar]
16
+ # harry = rw
17
+ # * =
18
+
19
+ # [repository:/baz/fuz]
20
+ # @harry_and_sally = rw
21
+ # * = r
@@ -0,0 +1,8 @@
1
+ ### This file is an example password file for svnserve.
2
+ ### Its format is similar to that of svnserve.conf. As shown in the
3
+ ### example below it contains one section labelled [users].
4
+ ### The name and password for each user follow, one account per line.
5
+
6
+ [users]
7
+ # harry = harryssecret
8
+ # sally = sallyssecret
@@ -0,0 +1,30 @@
1
+ ### This file controls the configuration of the svnserve daemon, if you
2
+ ### use it to allow access to this repository. (If you only allow
3
+ ### access through http: and/or file: URLs, then this file is
4
+ ### irrelevant.)
5
+
6
+ ### Visit http://subversion.tigris.org/ for more information.
7
+
8
+ [general]
9
+ ### These options control access to the repository for unauthenticated
10
+ ### and authenticated users. Valid values are "write", "read",
11
+ ### and "none". The sample settings below are the defaults.
12
+ # anon-access = read
13
+ # auth-access = write
14
+ ### The password-db option controls the location of the password
15
+ ### database file. Unless you specify a path starting with a /,
16
+ ### the file's location is relative to the conf directory.
17
+ ### Uncomment the line below to use the default password file.
18
+ # password-db = passwd
19
+ ### The authz-db option controls the location of the authorization
20
+ ### rules for path-based access control. Unless you specify a path
21
+ ### starting with a /, the file's location is relative to the conf
22
+ ### directory. If you don't specify an authz-db, no path-based access
23
+ ### control is done.
24
+ ### Uncomment the line below to use the default authorization file.
25
+ # authz-db = authz
26
+ ### This option specifies the authentication realm of the repository.
27
+ ### If two repositories have the same authentication realm, they should
28
+ ### have the same password database, and vice versa. The default realm
29
+ ### is repository's uuid.
30
+ # realm = My First Repository
@@ -0,0 +1,5 @@
1
+ K 8
2
+ svn:date
3
+ V 27
4
+ 2007-01-01T07:45:54.031250Z
5
+ END
@@ -0,0 +1,13 @@
1
+ K 10
2
+ svn:author
3
+ V 17
4
+ Shane and Lianxin
5
+ K 8
6
+ svn:date
7
+ V 27
8
+ 2007-01-01T07:45:54.796875Z
9
+ K 7
10
+ svn:log
11
+ V 24
12
+ creating trunk directory
13
+ END
@@ -0,0 +1,13 @@
1
+ K 10
2
+ svn:author
3
+ V 17
4
+ Shane and Lianxin
5
+ K 8
6
+ svn:date
7
+ V 27
8
+ 2007-01-01T07:45:55.109375Z
9
+ K 7
10
+ svn:log
11
+ V 23
12
+ creating tags directory
13
+ END
@@ -0,0 +1,13 @@
1
+ K 10
2
+ svn:author
3
+ V 17
4
+ Shane and Lianxin
5
+ K 8
6
+ svn:date
7
+ V 27
8
+ 2007-01-01T07:45:55.281250Z
9
+ K 7
10
+ svn:log
11
+ V 27
12
+ creating branches directory
13
+ END
@@ -0,0 +1,13 @@
1
+ K 10
2
+ svn:author
3
+ V 17
4
+ Shane and Lianxin
5
+ K 8
6
+ svn:date
7
+ V 27
8
+ 2007-01-01T07:45:57.593750Z
9
+ K 7
10
+ svn:log
11
+ V 19
12
+ testing the checkin
13
+ END