tetra 2.0.7 → 2.0.8

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 (222) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +3 -3
  3. data/README.md +5 -4
  4. data/bin/tetra +6 -4
  5. data/lib/template/bashrc +19 -14
  6. data/lib/template/bundled/apache-maven-3.9.12/LICENSE +616 -0
  7. data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/NOTICE +0 -6
  8. data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/mvn +9 -0
  9. data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/mvn.cmd +14 -0
  10. data/lib/template/bundled/{apache-maven-3.9.9/boot/plexus-classworlds-2.8.0.jar → apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar} +0 -0
  11. data/lib/template/bundled/apache-maven-3.9.12/lib/asm-9.9.jar +0 -0
  12. data/lib/template/bundled/apache-maven-3.9.12/lib/asm.license +29 -0
  13. data/lib/template/bundled/apache-maven-3.9.12/lib/commons-cli-1.11.0.jar +0 -0
  14. data/lib/template/bundled/apache-maven-3.9.12/lib/commons-codec-1.20.0.jar +0 -0
  15. data/lib/template/bundled/apache-maven-3.9.12/lib/error_prone_annotations-2.41.0.jar +0 -0
  16. data/lib/template/bundled/apache-maven-3.9.12/lib/failureaccess-1.0.3.jar +0 -0
  17. data/lib/template/bundled/apache-maven-3.9.12/lib/gson-2.13.2.jar +0 -0
  18. data/lib/template/bundled/apache-maven-3.9.12/lib/guava-33.5.0-jre.jar +0 -0
  19. data/lib/template/bundled/apache-maven-3.9.12/lib/guice-5.1.0-classes.jar +0 -0
  20. data/lib/template/bundled/{apache-maven-3.9.9/lib/jansi-2.4.1.jar → apache-maven-3.9.12/lib/jansi-2.4.2.jar} +0 -0
  21. data/lib/template/bundled/{apache-maven-3.9.9/lib/jansi-native/Windows/arm64/libjansi.so → apache-maven-3.9.12/lib/jansi-native/Windows/arm64/jansi.dll} +0 -0
  22. data/lib/template/bundled/apache-maven-3.9.12/lib/jspecify-1.0.0.jar +0 -0
  23. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-artifact-3.9.9.jar → apache-maven-3.9.12/lib/maven-artifact-3.9.12.jar} +0 -0
  24. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-builder-support-3.9.9.jar → apache-maven-3.9.12/lib/maven-builder-support-3.9.12.jar} +0 -0
  25. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-compat-3.9.9.jar → apache-maven-3.9.12/lib/maven-compat-3.9.12.jar} +0 -0
  26. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-core-3.9.9.jar → apache-maven-3.9.12/lib/maven-core-3.9.12.jar} +0 -0
  27. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-embedder-3.9.12.jar +0 -0
  28. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-model-3.9.12.jar +0 -0
  29. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-model-builder-3.9.9.jar → apache-maven-3.9.12/lib/maven-model-builder-3.9.12.jar} +0 -0
  30. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-plugin-api-3.9.12.jar +0 -0
  31. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-repository-metadata-3.9.12.jar +0 -0
  32. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-api-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-api-1.9.25.jar} +0 -0
  33. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-resolver-connector-basic-1.9.25.jar +0 -0
  34. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-impl-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-impl-1.9.25.jar} +0 -0
  35. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-named-locks-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-named-locks-1.9.25.jar} +0 -0
  36. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-provider-3.9.9.jar → apache-maven-3.9.12/lib/maven-resolver-provider-3.9.12.jar} +0 -0
  37. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-spi-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-spi-1.9.25.jar} +0 -0
  38. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-resolver-transport-file-1.9.25.jar +0 -0
  39. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-resolver-transport-http-1.9.25.jar +0 -0
  40. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-transport-wagon-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-transport-wagon-1.9.25.jar} +0 -0
  41. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-resolver-util-1.9.22.jar → apache-maven-3.9.12/lib/maven-resolver-util-1.9.25.jar} +0 -0
  42. data/lib/template/bundled/apache-maven-3.9.12/lib/maven-settings-3.9.12.jar +0 -0
  43. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-settings-builder-3.9.9.jar → apache-maven-3.9.12/lib/maven-settings-builder-3.9.12.jar} +0 -0
  44. data/lib/template/bundled/{apache-maven-3.9.9/lib/maven-slf4j-provider-3.9.9.jar → apache-maven-3.9.12/lib/maven-slf4j-provider-3.9.12.jar} +0 -0
  45. data/lib/template/bundled/{apache-maven-3.9.9/lib/org.eclipse.sisu.inject-0.9.0.M3.jar → apache-maven-3.9.12/lib/org.eclipse.sisu.inject-0.9.0.M4.jar} +0 -0
  46. data/lib/template/bundled/{apache-maven-3.9.9/lib/org.eclipse.sisu.plexus-0.9.0.M3.jar → apache-maven-3.9.12/lib/org.eclipse.sisu.plexus-0.9.0.M4.jar} +0 -0
  47. data/lib/template/bundled/apache-maven-3.9.12/lib/plexus-component-annotations-2.2.0.jar +0 -0
  48. data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-interpolation-1.27.jar → apache-maven-3.9.12/lib/plexus-interpolation-1.29.jar} +0 -0
  49. data/lib/template/bundled/apache-maven-3.9.12/lib/plexus-sec-dispatcher.license +202 -0
  50. data/lib/template/bundled/apache-maven-3.9.12/lib/plexus-utils-3.6.0.jar +0 -0
  51. data/lib/template/bundled/apache-maven-3.9.12/lib/plexus-utils.license +202 -0
  52. data/lib/template/kit.spec +3 -3
  53. data/lib/template/package.spec +13 -10
  54. data/lib/tetra/constants.rb +10 -1
  55. data/lib/tetra/data/license_map.yml +124 -0
  56. data/lib/tetra/facades/ant.rb +4 -7
  57. data/lib/tetra/facades/bash.rb +28 -19
  58. data/lib/tetra/facades/git.rb +69 -34
  59. data/lib/tetra/facades/gradle.rb +3 -2
  60. data/lib/tetra/facades/mvn.rb +8 -8
  61. data/lib/tetra/facades/process_runner.rb +58 -37
  62. data/lib/tetra/facades/tar.rb +5 -4
  63. data/lib/tetra/facades/unzip.rb +5 -4
  64. data/lib/tetra/generatable.rb +4 -3
  65. data/lib/tetra/kit.rb +12 -6
  66. data/lib/tetra/license_mapper.rb +34 -0
  67. data/lib/tetra/logger.rb +7 -4
  68. data/lib/tetra/maven_website.rb +64 -27
  69. data/lib/tetra/packages/kit_package.rb +4 -4
  70. data/lib/tetra/packages/package.rb +47 -8
  71. data/lib/tetra/packages/scriptable.rb +12 -8
  72. data/lib/tetra/packages/speccable.rb +7 -1
  73. data/lib/tetra/pom.rb +38 -16
  74. data/lib/tetra/pom_getter.rb +55 -43
  75. data/lib/tetra/project.rb +14 -15
  76. data/lib/tetra/project_initer.rb +32 -20
  77. data/lib/tetra/ui/change_sources_subcommand.rb +13 -7
  78. data/lib/tetra/ui/dry_run_subcommand.rb +5 -3
  79. data/lib/tetra/ui/generate_all_subcommand.rb +1 -1
  80. data/lib/tetra/ui/generate_kit_subcommand.rb +2 -1
  81. data/lib/tetra/ui/generate_script_subcommand.rb +2 -3
  82. data/lib/tetra/ui/generate_spec_subcommand.rb +3 -2
  83. data/lib/tetra/ui/get_pom_subcommand.rb +17 -12
  84. data/lib/tetra/ui/init_subcommand.rb +12 -4
  85. data/lib/tetra/ui/main.rb +6 -1
  86. data/lib/tetra/ui/move_jars_to_kit_subcommand.rb +2 -2
  87. data/lib/tetra/ui/patch_subcommand.rb +1 -1
  88. data/lib/tetra/ui/subcommand.rb +37 -31
  89. data/lib/tetra/version.rb +2 -3
  90. data/lib/tetra/version_matcher.rb +62 -44
  91. data/lib/tetra.rb +10 -6
  92. metadata +184 -274
  93. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -26
  94. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -15
  95. data/.github/dependabot.yml +0 -24
  96. data/.github/workflows/action-lint.yml +0 -15
  97. data/.github/workflows/codeql-analysis.yml +0 -94
  98. data/.github/workflows/dependency-review.yml +0 -17
  99. data/.github/workflows/markdown.yml +0 -23
  100. data/.github/workflows/rubocop.yml +0 -51
  101. data/.github/workflows/test.yml +0 -62
  102. data/.gitignore +0 -27
  103. data/.markdownlint.yaml +0 -11
  104. data/.rubocop.yml +0 -35
  105. data/.rubocop_todo.yml +0 -438
  106. data/.sonarcloud.properties +0 -4
  107. data/Gemfile +0 -6
  108. data/Gemfile.lock +0 -228
  109. data/Rakefile +0 -9
  110. data/lib/template/bundled/apache-maven-3.9.9/LICENSE +0 -760
  111. data/lib/template/bundled/apache-maven-3.9.9/lib/commons-cli-1.8.0.jar +0 -0
  112. data/lib/template/bundled/apache-maven-3.9.9/lib/commons-codec-1.17.1.jar +0 -0
  113. data/lib/template/bundled/apache-maven-3.9.9/lib/failureaccess-1.0.2.jar +0 -0
  114. data/lib/template/bundled/apache-maven-3.9.9/lib/guava-33.2.1-jre.jar +0 -0
  115. data/lib/template/bundled/apache-maven-3.9.9/lib/guice-5.1.0.jar +0 -0
  116. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-embedder-3.9.9.jar +0 -0
  117. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-model-3.9.9.jar +0 -0
  118. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-plugin-api-3.9.9.jar +0 -0
  119. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-repository-metadata-3.9.9.jar +0 -0
  120. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-resolver-connector-basic-1.9.22.jar +0 -0
  121. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-resolver-transport-file-1.9.22.jar +0 -0
  122. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-resolver-transport-http-1.9.22.jar +0 -0
  123. data/lib/template/bundled/apache-maven-3.9.9/lib/maven-settings-3.9.9.jar +0 -0
  124. data/lib/template/bundled/apache-maven-3.9.9/lib/plexus-component-annotations-2.1.0.jar +0 -0
  125. data/lib/template/bundled/apache-maven-3.9.9/lib/plexus-utils-3.5.1.jar +0 -0
  126. data/lib/template/bundled/apache-maven-3.9.9/lib/plexus-xml-3.0.1.jar +0 -0
  127. data/lib/template/kit/.keep +0 -1
  128. data/lib/template/kit/jars/.keep +0 -1
  129. data/lib/template/packages/.keep +0 -1
  130. data/lib/template/src/.keep +0 -1
  131. data/spec/data/ant-super-simple-code/build/HW.class +0 -0
  132. data/spec/data/ant-super-simple-code/build/mypackage/HW.class +0 -0
  133. data/spec/data/ant-super-simple-code/build.xml +0 -133
  134. data/spec/data/ant-super-simple-code/dist/antsimple-20130618.jar +0 -0
  135. data/spec/data/ant-super-simple-code/lib/junit-4.11.jar +0 -0
  136. data/spec/data/ant-super-simple-code/lib/log4j-1.2.13.jar +0 -0
  137. data/spec/data/ant-super-simple-code/src/mypackage/HW.java +0 -15
  138. data/spec/data/antlr/antlr-2.7.2.jar +0 -0
  139. data/spec/data/antlr/pom.xml +0 -6
  140. data/spec/data/commons-collections4-4.5.0-M2-src.tar.gz +0 -0
  141. data/spec/data/commons-collections4-4.5.0-M2-src.zip +0 -0
  142. data/spec/data/commons-logging/commons-logging-1.3.4.jar +0 -0
  143. data/spec/data/commons-logging/parent_pom.xml +0 -1995
  144. data/spec/data/commons-logging/pom.xml +0 -833
  145. data/spec/data/nailgun/nailgun-0.7.1.jar +0 -0
  146. data/spec/data/nailgun/pom.xml +0 -153
  147. data/spec/data/struts-apps/pom.xml +0 -1147
  148. data/spec/data/tomcat/pom.xml +0 -33
  149. data/spec/lib/coarse/dry_run_subcommand_spec.rb +0 -59
  150. data/spec/lib/coarse/generate_all_subcommand_spec.rb +0 -132
  151. data/spec/lib/coarse/generate_spec_subcommand_spec.rb +0 -30
  152. data/spec/lib/coarse/init_subcommand_spec.rb +0 -101
  153. data/spec/lib/coarse/main_spec.rb +0 -21
  154. data/spec/lib/fine/ant_spec.rb +0 -25
  155. data/spec/lib/fine/git_spec.rb +0 -181
  156. data/spec/lib/fine/kit_package_spec.rb +0 -31
  157. data/spec/lib/fine/kit_spec.rb +0 -27
  158. data/spec/lib/fine/maven_website_spec.rb +0 -61
  159. data/spec/lib/fine/mvn_spec.rb +0 -27
  160. data/spec/lib/fine/package_spec.rb +0 -68
  161. data/spec/lib/fine/pom_getter_spec.rb +0 -36
  162. data/spec/lib/fine/pom_spec.rb +0 -98
  163. data/spec/lib/fine/project_spec.rb +0 -234
  164. data/spec/lib/fine/scriptable_spec.rb +0 -56
  165. data/spec/lib/fine/speccable_spec.rb +0 -93
  166. data/spec/lib/fine/tar_spec.rb +0 -22
  167. data/spec/lib/fine/unzip_spec.rb +0 -22
  168. data/spec/lib/fine/version_matcher_spec.rb +0 -64
  169. data/spec/spec_helper.rb +0 -90
  170. data/tetra.gemspec +0 -44
  171. data/utils/delete_nonet_user.sh +0 -8
  172. data/utils/setup_nonet_user.sh +0 -8
  173. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/README.txt +0 -0
  174. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/m2.conf +0 -0
  175. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/mvnDebug +0 -0
  176. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/mvnDebug.cmd +0 -0
  177. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/bin/mvnyjp +0 -0
  178. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/boot/plexus-classworlds.license +0 -0
  179. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/conf/logging/simplelogger.properties +0 -0
  180. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/conf/settings.xml +0 -0
  181. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/conf/toolchains.xml +0 -0
  182. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/aopalliance-1.0.jar +0 -0
  183. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/aopalliance.license +0 -0
  184. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/commons-cli.license +0 -0
  185. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/commons-codec.license +0 -0
  186. /data/lib/template/bundled/{apache-maven-3.9.9/lib/failureaccess.license → apache-maven-3.9.12/lib/error_prone_annotations.license} +0 -0
  187. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/ext/README.txt +0 -0
  188. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/ext/hazelcast/README.txt +0 -0
  189. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/ext/redisson/README.txt +0 -0
  190. /data/lib/template/bundled/{apache-maven-3.9.9/lib/guava.license → apache-maven-3.9.12/lib/failureaccess.license} +0 -0
  191. /data/lib/template/bundled/{apache-maven-3.9.9/lib/guice.license → apache-maven-3.9.12/lib/gson.license} +0 -0
  192. /data/lib/template/bundled/{apache-maven-3.9.9/lib/httpclient.license → apache-maven-3.9.12/lib/guava.license} +0 -0
  193. /data/lib/template/bundled/{apache-maven-3.9.9/lib/httpcore.license → apache-maven-3.9.12/lib/guice.license} +0 -0
  194. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/httpclient-4.5.14.jar +0 -0
  195. /data/lib/template/bundled/{apache-maven-3.9.9/lib/jansi.license → apache-maven-3.9.12/lib/httpclient.license} +0 -0
  196. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/httpcore-4.4.16.jar +0 -0
  197. /data/lib/template/bundled/{apache-maven-3.9.9/lib/javax.inject.license → apache-maven-3.9.12/lib/httpcore.license} +0 -0
  198. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/jansi-native/README.txt +0 -0
  199. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/jansi-native/Windows/x86/jansi.dll +0 -0
  200. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/jansi-native/Windows/x86_64/jansi.dll +0 -0
  201. /data/lib/template/bundled/{apache-maven-3.9.9/lib/jcl-over-slf4j.license → apache-maven-3.9.12/lib/jansi.license} +0 -0
  202. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/javax.annotation-api-1.3.2.jar +0 -0
  203. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/javax.annotation-api.license +0 -0
  204. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/javax.inject-1.jar +0 -0
  205. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-cipher.license → apache-maven-3.9.12/lib/javax.inject.license} +0 -0
  206. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/jcl-over-slf4j-1.7.36.jar +0 -0
  207. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-component-annotations.license → apache-maven-3.9.12/lib/jcl-over-slf4j.license} +0 -0
  208. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-interpolation.license → apache-maven-3.9.12/lib/jspecify.license} +0 -0
  209. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/maven-shared-utils-3.4.2.jar +0 -0
  210. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/org.eclipse.sisu.inject.license +0 -0
  211. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/org.eclipse.sisu.plexus.license +0 -0
  212. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/plexus-cipher-2.0.jar +0 -0
  213. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-sec-dispatcher.license → apache-maven-3.9.12/lib/plexus-cipher.license} +0 -0
  214. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-utils.license → apache-maven-3.9.12/lib/plexus-component-annotations.license} +0 -0
  215. /data/lib/template/bundled/{apache-maven-3.9.9/lib/plexus-xml.license → apache-maven-3.9.12/lib/plexus-interpolation.license} +0 -0
  216. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/plexus-sec-dispatcher-2.0.jar +0 -0
  217. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/slf4j-api-1.7.36.jar +0 -0
  218. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/slf4j-api.license +0 -0
  219. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/wagon-file-3.5.3.jar +0 -0
  220. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/wagon-http-3.5.3.jar +0 -0
  221. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/wagon-http-shared-3.5.3.jar +0 -0
  222. /data/lib/template/bundled/{apache-maven-3.9.9 → apache-maven-3.9.12}/lib/wagon-provider-api-3.5.3.jar +0 -0
@@ -1,33 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- Licensed to the Apache Software Foundation (ASF) under one or more
4
- contributor license agreements. See the NOTICE file distributed with
5
- this work for additional information regarding copyright ownership.
6
- The ASF licenses this file to You under the Apache License, Version 2.0
7
- (the "License"); you may not use this file except in compliance with
8
- the License. You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
17
- -->
18
- <project>
19
- <modelVersion>4.0.0</modelVersion>
20
- <groupId>org.apache.tomcat</groupId>
21
- <artifactId>tomcat</artifactId>
22
- <version>11.0.2</version>
23
- <description>Binary distribution of Apache Tomcat</description>
24
- <url>http://tomcat.apache.org/</url>
25
- <packaging>pom</packaging>
26
- <licenses>
27
- <license>
28
- <name>Apache License, Version 2.0</name>
29
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
30
- <distribution>repo</distribution>
31
- </license>
32
- </licenses>
33
- </project>
@@ -1,59 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "`tetra dry-run`", type: :aruba do
4
- it "does not start a dry-run if init has not run yet" do
5
- # Expecting failure, so we disable fail_on_error
6
- run_command_and_stop("tetra dry-run", fail_on_error: false)
7
-
8
- expect(last_command_started.stderr).to include("is not a tetra project directory")
9
- end
10
-
11
- it "does a dry-run build" do
12
- run_command_and_stop("tetra init --no-archive mypackage")
13
- cd("mypackage")
14
-
15
- # Interactive Step:
16
- # 1. Start the command asynchronously (don't wait yet)
17
- run_command("tetra dry-run")
18
-
19
- # 2. Send input to the running process
20
- type("echo ciao")
21
- type("echo ciao > ciao.jar")
22
- type("\u{0004}") # ^D (Ctrl+D) to exit the shell
23
-
24
- # 3. Wait for the command to finish processing input and exit
25
- stop_all_commands
26
-
27
- # Check output of the interactive session
28
- output = last_command_started.output
29
- expect(output).to include("Dry-run started")
30
- expect(output).to include("bash shell")
31
- expect(output).to include("ciao")
32
- expect(output).to include("Dry-run finished")
33
-
34
- # check that markers were written in git repo
35
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD~")
36
- expect(last_command_started.stdout).to include("tetra: dry-run-started")
37
-
38
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD")
39
- expect(last_command_started.stdout).to include("tetra: dry-run-finished")
40
- expect(last_command_started.stdout).to include("tetra: build-script-line: echo ciao")
41
- end
42
-
43
- it "does a scripted dry-run" do
44
- run_command_and_stop("tetra init --no-archive mypackage")
45
- cd("mypackage")
46
-
47
- run_command_and_stop("tetra dry-run -s 'echo ciao > ciao.jar'")
48
-
49
- expect(last_command_started.output).to include("Scripted dry-run started")
50
-
51
- # check that markers were written in git repo
52
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD~")
53
- expect(last_command_started.stdout).to include("tetra: dry-run-started")
54
-
55
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD")
56
- expect(last_command_started.stdout).to include("tetra: dry-run-finished")
57
- expect(last_command_started.stdout).to include("tetra: build-script-line: echo ciao > ciao.jar")
58
- end
59
- end
@@ -1,132 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "`tetra generate-all`", type: :aruba do
4
- it "generates specs and tarballs for a sample package, source archive workflow" do
5
- archive_contents = File.read(File.join("spec", "data", "#{Tetra::CCOLLECTIONS}.zip"))
6
- write_file("commons-collections.zip", archive_contents)
7
-
8
- # init project
9
- run_command_and_stop("tetra init commons-collections commons-collections.zip", exit_timeout: 120)
10
- cd(File.join("commons-collections", "src", Tetra::CCOLLECTIONS))
11
-
12
- # first dry-run, all normal (Interactive & Slow)
13
- run_command("tetra dry-run --very-very-verbose", exit_timeout: 240)
14
- type("mvn package -DskipTests")
15
- type("\u{0004}") # ^D (Ctrl+D)
16
- stop_all_commands
17
-
18
- expect(last_command_started.output).to include("[INFO] BUILD SUCCESS")
19
- expect(last_command_started.output).to include("Checking for tetra project")
20
-
21
- # first generate-all, all normal
22
- run_command_and_stop("tetra generate-all", exit_timeout: 120)
23
-
24
- expect(last_command_started.output).to include("commons-collections-kit.spec generated")
25
- expect(last_command_started.output).to include("commons-collections-kit.tar.xz generated")
26
- expect(last_command_started.output).to include("build.sh generated")
27
- expect(last_command_started.output).to include("commons-collections.spec generated")
28
-
29
- # patch one file
30
- append_to_file("README.txt", "patched by tetra test")
31
-
32
- # second dry-run fails: sources changed
33
- run_command_and_stop("tetra dry-run", fail_on_error: false)
34
- expect(last_command_started.output).to include("Changes detected in src")
35
- expect(last_command_started.output).to include("Dry run not started")
36
-
37
- # run patch
38
- run_command_and_stop("tetra patch")
39
-
40
- # third dry-run succeeds with patch (Interactive & Slow)
41
- run_command("tetra dry-run", exit_timeout: 240)
42
- type("mvn package -DskipTests")
43
- type("\u{0004}")
44
- stop_all_commands
45
-
46
- expect(last_command_started.output).to include("[INFO] BUILD SUCCESS")
47
-
48
- run_command_and_stop("tetra generate-all --very-very-verbose", exit_timeout: 120)
49
-
50
- expect(last_command_started.output).to include("commons-collections-kit.spec generated")
51
- expect(last_command_started.output).to include("commons-collections-kit.tar.xz generated")
52
- expect(last_command_started.output).to include("build.sh generated")
53
- expect(last_command_started.output).to include("commons-collections.spec generated")
54
- expect(last_command_started.output).to include("0001-Sources-updated.patch generated")
55
-
56
- # rubocop:disable RSpec/ExpectActual
57
- expect("../../packages/commons-collections/commons-collections.spec").to have_file_content(/0001-Sources-updated.patch/)
58
- # rubocop:enable RSpec/ExpectActual
59
- end
60
-
61
- it "generates specs and tarballs for a sample package, manual source workflow" do
62
- archive_contents = File.read(File.join("spec", "data", "#{Tetra::CCOLLECTIONS}.zip"))
63
- write_file("commons-collections.zip", archive_contents)
64
-
65
- # init project
66
- run_command_and_stop("tetra init -n commons-collections")
67
-
68
- # add sources
69
- run_command_and_stop("unzip commons-collections.zip -d commons-collections/src")
70
-
71
- cd("commons-collections")
72
-
73
- # first dry-run fails: sources changed
74
- run_command_and_stop("tetra dry-run", fail_on_error: false)
75
- expect(last_command_started.output).to include("Changes detected in src")
76
- expect(last_command_started.output).to include("Dry run not started")
77
-
78
- # run change-sources
79
- run_command_and_stop("tetra change-sources ../commons-collections.zip")
80
- expect(last_command_started.output).to include("New sources committed")
81
-
82
- # second dry-run, all normal (Interactive & Slow)
83
- cd(File.join("src", Tetra::CCOLLECTIONS))
84
-
85
- run_command("tetra dry-run", exit_timeout: 240)
86
- type("mvn package -DskipTests")
87
- type("\u{0004}")
88
- stop_all_commands
89
-
90
- expect(last_command_started.output).to include("[INFO] BUILD SUCCESS")
91
-
92
- # first generate-all, all normal
93
- run_command_and_stop("tetra generate-all", exit_timeout: 120)
94
-
95
- expect(last_command_started.output).to include("commons-collections-kit.spec generated")
96
- expect(last_command_started.output).to include("commons-collections-kit.tar.xz generated")
97
- expect(last_command_started.output).to include("build.sh generated")
98
- expect(last_command_started.output).to include("commons-collections.spec generated")
99
-
100
- # patch one file
101
- append_to_file("README.txt", "patched by tetra test")
102
-
103
- # second dry-run fails: sources changed
104
- run_command_and_stop("tetra dry-run", fail_on_error: false)
105
- expect(last_command_started.output).to include("Changes detected in src")
106
- expect(last_command_started.output).to include("Dry run not started")
107
-
108
- # run patch
109
- run_command_and_stop("tetra patch")
110
-
111
- # third dry-run succeeds with patch (Interactive & Slow)
112
- run_command("tetra dry-run", exit_timeout: 240)
113
- type("mvn package -DskipTests")
114
- type("\u{0004}")
115
- stop_all_commands
116
-
117
- expect(last_command_started.output).to include("[INFO] BUILD SUCCESS")
118
-
119
- run_command_and_stop("tetra generate-all", exit_timeout: 120)
120
-
121
- expect(last_command_started.output).to include("commons-collections-kit.spec generated")
122
- expect(last_command_started.output).to include("commons-collections-kit.tar.xz generated")
123
- expect(last_command_started.output).to include("build.sh generated")
124
- expect(last_command_started.output).to include("commons-collections.spec generated")
125
- expect(last_command_started.output).to include("0001-Sources-updated.patch generated")
126
-
127
- # rubocop:disable RSpec/ExpectActual
128
- expect("../../packages/commons-collections/commons-collections.spec").to have_file_content(/0001-Sources-updated.patch/)
129
- expect("../../packages/commons-collections/commons-collections.spec").to have_file_content(/commons-collections.zip/)
130
- # rubocop:enable RSpec/ExpectActual
131
- end
132
- end
@@ -1,30 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "`tetra generate-spec`", type: :aruba do
4
- it "outputs a warning if source files are not found" do
5
- archive_contents = File.read(File.join("spec", "data", "#{Tetra::CCOLLECTIONS}.zip"))
6
- write_file("commons-collections.zip", archive_contents)
7
-
8
- run_command_and_stop("tetra init --no-archive commons-collections")
9
- cd("commons-collections")
10
-
11
- cd("src")
12
- run_command_and_stop("unzip ../../commons-collections.zip")
13
- cd(Tetra::CCOLLECTIONS)
14
-
15
- run_command_and_stop("tetra change-sources --no-archive")
16
- expect(last_command_started.output).to include("New sources committed")
17
-
18
- # Interactive dry-run with increased timeout
19
- run_command("tetra dry-run", exit_timeout: 300)
20
- type("mvn package -DskipTests")
21
- type("\u{0004}") # ^D (Ctrl+D)
22
- stop_all_commands
23
-
24
- expect(last_command_started.output).to include("[INFO] BUILD SUCCESS")
25
-
26
- run_command_and_stop("tetra generate-spec")
27
-
28
- expect(last_command_started.output).to include("Warning: source archive not found, package will not build")
29
- end
30
- end
@@ -1,101 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "`tetra`", type: :aruba do
4
- it "shows an error if required parameters are not set" do
5
- run_command_and_stop("tetra init", fail_on_error: false)
6
-
7
- expect(last_command_started.stderr).to include("parameter 'PACKAGE_NAME': no value provided")
8
- end
9
-
10
- it "shows an error if required parameters are not set, even if options are set" do
11
- run_command_and_stop("tetra init -n", fail_on_error: false)
12
-
13
- expect(last_command_started.stderr).to include("parameter 'PACKAGE_NAME': no value provided")
14
- end
15
-
16
- it "shows an error if no sources are specified and -n is not set" do
17
- run_command_and_stop("tetra init mypackage", fail_on_error: false)
18
-
19
- expect(last_command_started.stderr).to include("please specify a source archive")
20
-
21
- # Old: check_directory_presence(["mypackage"], false)
22
- expect("mypackage").not_to be_an_existing_directory
23
- end
24
-
25
- it "inits a new project without sources" do
26
- run_command_and_stop("tetra init --no-archive mypackage")
27
-
28
- expect(last_command_started.output).to include("Project inited in mypackage/.")
29
-
30
- # Old: check_directory_presence(["mypackage"], true)
31
- expect("mypackage").to be_an_existing_directory
32
-
33
- cd("mypackage")
34
-
35
- # Old: check_directory_presence([".git", "kit", "src"], true)
36
- expect(".git").to be_an_existing_directory
37
- expect("kit").to be_an_existing_directory
38
- expect("src").to be_an_existing_directory
39
- end
40
-
41
- it "inits a new project with a zip source file" do
42
- # NOTE: File.read runs in RSpec process (project root), write_file writes to Aruba tmp dir
43
- archive_contents = File.read(File.join("spec", "data", "#{Tetra::CCOLLECTIONS}.zip"))
44
- write_file("commons-collections.zip", archive_contents)
45
-
46
- run_command_and_stop("tetra init commons-collections commons-collections.zip")
47
-
48
- output = last_command_started.output
49
- expect(output).to include("Project inited in commons-collections/.")
50
- expect(output).to include("Sources decompressed in commons-collections/src/")
51
- expect(output).to include("original archive copied in commons-collections/packages/.")
52
- expect(output).to include("Please add any other precompiled build dependency to kit/.")
53
-
54
- expect("commons-collections").to be_an_existing_directory
55
-
56
- cd("commons-collections")
57
-
58
- expect(".git").to be_an_existing_directory
59
- expect("kit").to be_an_existing_directory
60
- expect("src").to be_an_existing_directory
61
- expect("packages").to be_an_existing_directory
62
-
63
- expect(File.join("src", Tetra::CCOLLECTIONS)).to be_an_existing_directory
64
- expect(File.join("src", Tetra::CCOLLECTIONS, "pom.xml")).to be_an_existing_file
65
-
66
- expect(File.join("packages", "commons-collections", "commons-collections.zip")).to be_an_existing_file
67
-
68
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD")
69
- expect(last_command_started.stdout).to include("Inital sources added from archive")
70
- end
71
-
72
- it "inits a new project with a tar source file" do
73
- archive_contents = File.read(File.join("spec", "data", "#{Tetra::CCOLLECTIONS}.tar.gz"))
74
- write_file("commons-collections.tar.gz", archive_contents)
75
-
76
- run_command_and_stop("tetra init commons-collections commons-collections.tar.gz")
77
-
78
- output = last_command_started.output
79
- expect(output).to include("Project inited in commons-collections/.")
80
- expect(output).to include("Sources decompressed in commons-collections/src/")
81
- expect(output).to include("original archive copied in commons-collections/packages/.")
82
- expect(output).to include("Please add any other precompiled build dependency to kit/.")
83
-
84
- expect("commons-collections").to be_an_existing_directory
85
-
86
- cd("commons-collections")
87
-
88
- expect(".git").to be_an_existing_directory
89
- expect("kit").to be_an_existing_directory
90
- expect("src").to be_an_existing_directory
91
- expect("packages").to be_an_existing_directory
92
-
93
- expect(File.join("src", Tetra::CCOLLECTIONS)).to be_an_existing_directory
94
- expect(File.join("src", Tetra::CCOLLECTIONS, "pom.xml")).to be_an_existing_file
95
-
96
- expect(File.join("packages", "commons-collections", "commons-collections.tar.gz")).to be_an_existing_file
97
-
98
- run_command_and_stop("git rev-list --format=%B --max-count=1 HEAD")
99
- expect(last_command_started.stdout).to include("Inital sources added from archive")
100
- end
101
- end
@@ -1,21 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "`tetra`", type: :aruba do
4
- it "lists subcommands" do
5
- # Run the command and wait for it to finish
6
- run_command_and_stop("tetra")
7
-
8
- # Check the output of the command that just finished
9
- expect(last_command_started.stdout).to include("Usage:")
10
-
11
- expect(last_command_started.stdout).to include("init")
12
- expect(last_command_started.stdout).to include("dry-run")
13
- expect(last_command_started.stdout).to include("generate-kit")
14
- expect(last_command_started.stdout).to include("generate-script")
15
- expect(last_command_started.stdout).to include("generate-spec")
16
- expect(last_command_started.stdout).to include("generate-all")
17
- expect(last_command_started.stdout).to include("patch")
18
- expect(last_command_started.stdout).to include("move-jars-to-kit")
19
- expect(last_command_started.stdout).to include("get-pom")
20
- end
21
- end
@@ -1,25 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require "spec_helper"
4
-
5
- describe Tetra::Ant do
6
- include Tetra::Mockers
7
-
8
- before(:each) do
9
- create_mock_project
10
- @path = create_mock_executable("ant")
11
- end
12
-
13
- after(:each) do
14
- delete_mock_project
15
- end
16
-
17
- describe "#get_ant_commandline" do
18
- it "returns commandline options for running Ant" do
19
- @project.from_directory do
20
- commandline = Tetra::Ant.commandline(".", mock_executable_dir("ant"))
21
- expect(commandline).to eq "./#{@path}"
22
- end
23
- end
24
- end
25
- end
@@ -1,181 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require "spec_helper"
4
-
5
- describe Tetra::Git do
6
- before(:each) do
7
- @git_path = File.expand_path(File.join("spec", "data", "test-repo"))
8
- Dir.mkdir(@git_path)
9
-
10
- @git = Tetra::Git.new(@git_path)
11
- @git.init
12
- end
13
-
14
- after(:each) do
15
- FileUtils.rm_rf(@git_path)
16
- end
17
-
18
- describe "#init" do
19
- it "complains if a double initialization is attempted" do
20
- expect do
21
- @git.init
22
- end.to raise_error(Tetra::GitAlreadyInitedError)
23
- end
24
- end
25
-
26
- describe "#latest_id" do
27
- it "does not find a commit with a non-existing comment" do
28
- Dir.chdir(@git_path) do
29
- @git.commit_file(".", "initial commit")
30
- expect(@git.latest_id("tetra: test")).to be_nil
31
- end
32
- end
33
- it "finds a commit with a certain comment" do
34
- Dir.chdir(@git_path) do
35
- @git.commit_file(".", "tetra: test")
36
- expect(@git.latest_id("tetra: test")).to eq `git rev-parse HEAD`.strip
37
- end
38
- end
39
- end
40
-
41
- describe "#commit_directories" do
42
- it "commits contents of multiple directories to git for later use" do
43
- Dir.chdir(@git_path) do
44
- FileUtils.touch("file1")
45
- Dir.mkdir("subdir1")
46
- FileUtils.touch(File.join("subdir1", "file2"))
47
- Dir.mkdir("subdir2")
48
- FileUtils.touch(File.join("subdir2", "file3"))
49
-
50
- @git.commit_directories(%w(subdir1 subdir2), "test")
51
-
52
- files = `git ls-tree --name-only -r HEAD`.split("\n")
53
-
54
- expect(files).not_to include("file1")
55
- expect(files).to include("subdir1/file2")
56
- expect(files).to include("subdir2/file3")
57
- end
58
- end
59
- end
60
-
61
- describe "#revert_directories" do
62
- it "reverts contents of multiple directories from git" do
63
- Dir.chdir(@git_path) do
64
- FileUtils.touch("expected_file")
65
- Dir.mkdir("subdir1")
66
- FileUtils.touch(File.join("subdir1", "expected_file"))
67
- Dir.mkdir("subdir2")
68
- FileUtils.touch(File.join("subdir2", "expected_file"))
69
- @git.commit_directories(["."], "test-start")
70
-
71
- FileUtils.touch(File.join("subdir1", "unexpected_file"))
72
- FileUtils.touch(File.join("subdir2", "unexpected_file"))
73
-
74
- @git.commit_directories(%w(subdir1 subdir2), "test-end")
75
-
76
- @git.revert_directories(%w(subdir1 subdir2), @git.latest_id("test-start"))
77
-
78
- files = Find.find(".").to_a
79
-
80
- expect(files).to include("./expected_file")
81
- expect(files).to include("./subdir1/expected_file")
82
- expect(files).to include("./subdir2/expected_file")
83
- expect(files).not_to include("./subdir1/unexpected_file")
84
- expect(files).not_to include("./subdir2/unexpected_file")
85
- end
86
- end
87
- end
88
-
89
- describe "#disable_special_files" do
90
- it "renames git special files to 'disable' them" do
91
- Dir.chdir(@git_path) do
92
- Dir.mkdir("src")
93
- FileUtils.touch(File.join("src", ".gitignore"))
94
- Dir.mkdir(File.join("src", ".git"))
95
-
96
- @git.disable_special_files("src")
97
-
98
- files = Dir.new("src").to_a
99
-
100
- expect(files).not_to include(".gitignore")
101
- expect(files).not_to include(".git")
102
- end
103
- end
104
- end
105
-
106
- describe "#changed_files" do
107
- it "checks if a directory is clean from changes" do
108
- Dir.chdir(@git_path) do
109
- @git.commit_file(".", "initial commit")
110
- Dir.mkdir("directory")
111
- FileUtils.touch(File.join("directory", "file"))
112
- expect(@git.changed_files("directory", "HEAD")).to include("directory/file")
113
-
114
- `git add directory/file`
115
- expect(@git.changed_files("directory", "HEAD")).to include("directory/file")
116
-
117
- @git.commit_file(File.join("directory", "file"), "test")
118
- expect(@git.changed_files("directory", "HEAD")).to be_empty
119
-
120
- expect(@git.changed_files("directory", "HEAD~")).to include("directory/file")
121
- end
122
- end
123
- end
124
-
125
- describe "#archive" do
126
- it "archives a version of a directory" do
127
- Dir.chdir(@git_path) do
128
- @git.commit_file(".", "initial commit")
129
-
130
- FileUtils.touch(File.join("outside_not_archived"))
131
- Dir.mkdir("directory")
132
- FileUtils.touch(File.join("directory", "file"))
133
- @git.commit_file("directory", "test")
134
-
135
- FileUtils.touch(File.join("directory", "later_not_archived"))
136
-
137
- @git.commit_file("directory", "later")
138
-
139
- destination_path = @git.archive("directory", @git.latest_id("test"), "archive.tar.xz")
140
- expect(destination_path).to match(/archive.tar.xz$/)
141
-
142
- file_list = `tar --list -f archive.tar.xz`.split
143
- expect(file_list).not_to include("outside_not_archived")
144
- expect(file_list).to include("directory/file")
145
- expect(file_list).not_to include("directory/later_not_archived")
146
- end
147
- end
148
- end
149
-
150
- describe "#format_patch" do
151
- it "creates patch files from commits" do
152
- Dir.chdir(@git_path) do
153
- outside_dir_file = File.join("outside_dir")
154
- inside_dir_not_patched_file = File.join("directory", "inside_dir_not_patched")
155
- inside_dir_patched_file = File.join("directory", "inside_dir_patched")
156
-
157
- Dir.mkdir("directory")
158
- FileUtils.touch(outside_dir_file)
159
- FileUtils.touch(inside_dir_not_patched_file)
160
- FileUtils.touch(inside_dir_patched_file)
161
- @git.commit_file(".", "initial")
162
-
163
- File.open(outside_dir_file, "w") { |f| f.write("A") }
164
- File.open(inside_dir_patched_file, "w") { |f| f.write("A") }
165
- @git.commit_file(".", "patch")
166
-
167
- Dir.mkdir("patches")
168
- patch_names = @git.format_patch("directory", "HEAD~", "patches")
169
-
170
- expect(patch_names).to include("patches/0001-patch.patch")
171
-
172
- patch_contents = File.readlines(File.join("patches", "0001-patch.patch"))
173
- expect(patch_contents).to include("--- a/#{inside_dir_patched_file}\n")
174
- expect(patch_contents).not_to include("--- a/#{outside_dir_file}\n")
175
- expect(patch_contents).not_to include("--- a/#{inside_dir_not_patched_file}\n")
176
- expect(patch_contents).to include("@@ -0,0 +1 @@\n")
177
- expect(patch_contents).to include("+A\n")
178
- end
179
- end
180
- end
181
- end
@@ -1,31 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require "spec_helper"
4
-
5
- describe Tetra::KitPackage do
6
- include Tetra::Mockers
7
-
8
- before(:each) do
9
- create_mock_project
10
- end
11
-
12
- after(:each) do
13
- delete_mock_project
14
- end
15
-
16
- let(:instance) { Tetra::KitPackage.new(@project) }
17
- let(:package_name) { instance.name }
18
-
19
- describe "#to_spec" do
20
- it "generates a specfile" do
21
- expect(instance.to_spec).to be_truthy
22
-
23
- @project.from_directory do
24
- spec_lines = File.readlines(File.join("packages", package_name, "#{package_name}.spec"))
25
-
26
- expect(spec_lines).to include("Conflicts: otherproviders(tetra-kit)\n")
27
- expect(spec_lines).to include("Provides: tetra-kit\n")
28
- end
29
- end
30
- end
31
- end
@@ -1,27 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require "spec_helper"
4
-
5
- describe Tetra::Kit do
6
- include Tetra::Mockers
7
-
8
- before(:each) do
9
- create_mock_project
10
- end
11
-
12
- let(:instance) { Tetra::Kit.new(@project) }
13
-
14
- after(:each) do
15
- delete_mock_project
16
- end
17
-
18
- describe "#find_executable" do
19
- it "finds an executable in kit" do
20
- create_mock_executable("any")
21
- expect(instance.find_executable("any")).to eq mock_executable_dir("any")
22
- end
23
- it "doesn't find an executable in kit" do
24
- expect(instance.find_executable("any")).to be_nil
25
- end
26
- end
27
- end