rubygems-update 3.3.18 → 3.3.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Manifest.txt +1 -0
  4. data/bin/gem +2 -2
  5. data/bin/update_rubygems +4 -4
  6. data/bundler/CHANGELOG.md +29 -0
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/common.rb +1 -0
  9. data/bundler/lib/bundler/definition.rb +31 -12
  10. data/bundler/lib/bundler/dsl.rb +2 -2
  11. data/bundler/lib/bundler/incomplete_specification.rb +12 -0
  12. data/bundler/lib/bundler/index.rb +10 -12
  13. data/bundler/lib/bundler/lazy_specification.rb +15 -6
  14. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  15. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  16. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  17. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-config.1 +13 -3
  20. data/bundler/lib/bundler/man/bundle-config.1.ronn +9 -2
  21. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
  23. data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -1
  24. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-inject.1 +5 -2
  28. data/bundler/lib/bundler/man/bundle-inject.1.ronn +3 -1
  29. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-viz.1 +4 -1
  40. data/bundler/lib/bundler/man/bundle-viz.1.ronn +2 -0
  41. data/bundler/lib/bundler/man/bundle.1 +3 -3
  42. data/bundler/lib/bundler/man/bundle.1.ronn +2 -2
  43. data/bundler/lib/bundler/man/gemfile.5 +16 -10
  44. data/bundler/lib/bundler/man/gemfile.5.ronn +23 -16
  45. data/bundler/lib/bundler/remote_specification.rb +5 -4
  46. data/bundler/lib/bundler/resolver.rb +5 -6
  47. data/bundler/lib/bundler/rubygems_gem_installer.rb +19 -12
  48. data/bundler/lib/bundler/settings.rb +1 -0
  49. data/bundler/lib/bundler/spec_set.rb +29 -21
  50. data/bundler/lib/bundler/version.rb +1 -1
  51. data/bundler/lib/bundler.rb +1 -0
  52. data/lib/rubygems/basic_specification.rb +2 -2
  53. data/lib/rubygems/command.rb +19 -19
  54. data/lib/rubygems/command_manager.rb +9 -9
  55. data/lib/rubygems/commands/build_command.rb +8 -8
  56. data/lib/rubygems/commands/cert_command.rb +32 -32
  57. data/lib/rubygems/commands/check_command.rb +20 -20
  58. data/lib/rubygems/commands/cleanup_command.rb +16 -16
  59. data/lib/rubygems/commands/contents_command.rb +12 -12
  60. data/lib/rubygems/commands/dependency_command.rb +12 -12
  61. data/lib/rubygems/commands/environment_command.rb +5 -5
  62. data/lib/rubygems/commands/fetch_command.rb +6 -6
  63. data/lib/rubygems/commands/generate_index_command.rb +15 -15
  64. data/lib/rubygems/commands/help_command.rb +3 -3
  65. data/lib/rubygems/commands/info_command.rb +3 -3
  66. data/lib/rubygems/commands/install_command.rb +13 -13
  67. data/lib/rubygems/commands/list_command.rb +3 -3
  68. data/lib/rubygems/commands/lock_command.rb +4 -4
  69. data/lib/rubygems/commands/mirror_command.rb +3 -3
  70. data/lib/rubygems/commands/open_command.rb +9 -9
  71. data/lib/rubygems/commands/outdated_command.rb +5 -5
  72. data/lib/rubygems/commands/owner_command.rb +11 -11
  73. data/lib/rubygems/commands/pristine_command.rb +31 -31
  74. data/lib/rubygems/commands/push_command.rb +8 -8
  75. data/lib/rubygems/commands/query_command.rb +8 -8
  76. data/lib/rubygems/commands/rdoc_command.rb +17 -17
  77. data/lib/rubygems/commands/search_command.rb +3 -3
  78. data/lib/rubygems/commands/server_command.rb +3 -3
  79. data/lib/rubygems/commands/setup_command.rb +92 -102
  80. data/lib/rubygems/commands/signin_command.rb +9 -9
  81. data/lib/rubygems/commands/signout_command.rb +7 -7
  82. data/lib/rubygems/commands/sources_command.rb +19 -19
  83. data/lib/rubygems/commands/specification_command.rb +11 -11
  84. data/lib/rubygems/commands/stale_command.rb +2 -2
  85. data/lib/rubygems/commands/uninstall_command.rb +36 -36
  86. data/lib/rubygems/commands/unpack_command.rb +12 -12
  87. data/lib/rubygems/commands/update_command.rb +35 -51
  88. data/lib/rubygems/commands/which_command.rb +6 -6
  89. data/lib/rubygems/commands/yank_command.rb +11 -11
  90. data/lib/rubygems/config_file.rb +14 -14
  91. data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
  92. data/lib/rubygems/core_ext/kernel_require.rb +1 -1
  93. data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
  94. data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
  95. data/lib/rubygems/defaults.rb +15 -15
  96. data/lib/rubygems/dependency.rb +4 -4
  97. data/lib/rubygems/dependency_installer.rb +8 -8
  98. data/lib/rubygems/dependency_list.rb +2 -2
  99. data/lib/rubygems/doctor.rb +16 -16
  100. data/lib/rubygems/errors.rb +2 -2
  101. data/lib/rubygems/exceptions.rb +4 -4
  102. data/lib/rubygems/ext/build_error.rb +1 -1
  103. data/lib/rubygems/ext/builder.rb +16 -16
  104. data/lib/rubygems/ext/cargo_builder.rb +7 -7
  105. data/lib/rubygems/ext/cmake_builder.rb +2 -2
  106. data/lib/rubygems/ext/configure_builder.rb +1 -1
  107. data/lib/rubygems/ext/ext_conf_builder.rb +6 -6
  108. data/lib/rubygems/ext/rake_builder.rb +3 -3
  109. data/lib/rubygems/ext.rb +7 -7
  110. data/lib/rubygems/gem_runner.rb +5 -5
  111. data/lib/rubygems/gemcutter_utilities.rb +30 -27
  112. data/lib/rubygems/indexer.rb +24 -24
  113. data/lib/rubygems/install_default_message.rb +2 -2
  114. data/lib/rubygems/install_message.rb +2 -2
  115. data/lib/rubygems/install_update_options.rb +55 -55
  116. data/lib/rubygems/installer.rb +27 -27
  117. data/lib/rubygems/installer_uninstaller_utils.rb +2 -2
  118. data/lib/rubygems/local_remote_options.rb +18 -20
  119. data/lib/rubygems/mock_gem_ui.rb +2 -2
  120. data/lib/rubygems/name_tuple.rb +1 -1
  121. data/lib/rubygems/optparse.rb +1 -1
  122. data/lib/rubygems/package/file_source.rb +2 -2
  123. data/lib/rubygems/package/old.rb +8 -8
  124. data/lib/rubygems/package/tar_header.rb +33 -33
  125. data/lib/rubygems/package/tar_reader/entry.rb +2 -2
  126. data/lib/rubygems/package/tar_reader.rb +1 -1
  127. data/lib/rubygems/package/tar_writer.rb +6 -6
  128. data/lib/rubygems/package.rb +35 -35
  129. data/lib/rubygems/package_task.rb +4 -4
  130. data/lib/rubygems/platform.rb +42 -42
  131. data/lib/rubygems/psych_tree.rb +1 -1
  132. data/lib/rubygems/query_utils.rb +27 -27
  133. data/lib/rubygems/rdoc.rb +2 -2
  134. data/lib/rubygems/remote_fetcher.rb +19 -19
  135. data/lib/rubygems/request/connection_pools.rb +2 -2
  136. data/lib/rubygems/request.rb +21 -21
  137. data/lib/rubygems/request_set/gem_dependency_api.rb +15 -15
  138. data/lib/rubygems/request_set/lockfile/parser.rb +14 -14
  139. data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -2
  140. data/lib/rubygems/request_set/lockfile.rb +5 -5
  141. data/lib/rubygems/request_set.rb +14 -14
  142. data/lib/rubygems/requirement.rb +5 -5
  143. data/lib/rubygems/resolver/activation_request.rb +3 -3
  144. data/lib/rubygems/resolver/api_set.rb +4 -4
  145. data/lib/rubygems/resolver/api_specification.rb +2 -2
  146. data/lib/rubygems/resolver/best_set.rb +2 -2
  147. data/lib/rubygems/resolver/conflict.rb +7 -7
  148. data/lib/rubygems/resolver/dependency_request.rb +2 -2
  149. data/lib/rubygems/resolver/git_set.rb +2 -2
  150. data/lib/rubygems/resolver/git_specification.rb +3 -3
  151. data/lib/rubygems/resolver/index_set.rb +3 -3
  152. data/lib/rubygems/resolver/index_specification.rb +3 -3
  153. data/lib/rubygems/resolver/installed_specification.rb +2 -2
  154. data/lib/rubygems/resolver/installer_set.rb +4 -4
  155. data/lib/rubygems/resolver/local_specification.rb +2 -2
  156. data/lib/rubygems/resolver/lock_set.rb +3 -3
  157. data/lib/rubygems/resolver/lock_specification.rb +3 -3
  158. data/lib/rubygems/resolver/molinillo.rb +1 -1
  159. data/lib/rubygems/resolver/specification.rb +1 -1
  160. data/lib/rubygems/resolver/vendor_set.rb +1 -1
  161. data/lib/rubygems/resolver.rb +35 -35
  162. data/lib/rubygems/s3_uri_signer.rb +6 -6
  163. data/lib/rubygems/safe_yaml.rb +2 -2
  164. data/lib/rubygems/security/policies.rb +11 -11
  165. data/lib/rubygems/security/policy.rb +12 -12
  166. data/lib/rubygems/security/signer.rb +4 -4
  167. data/lib/rubygems/security/trust_dir.rb +3 -3
  168. data/lib/rubygems/security.rb +27 -27
  169. data/lib/rubygems/security_option.rb +5 -5
  170. data/lib/rubygems/source/git.rb +17 -17
  171. data/lib/rubygems/source/installed.rb +1 -1
  172. data/lib/rubygems/source/local.rb +2 -2
  173. data/lib/rubygems/source/specific_file.rb +1 -1
  174. data/lib/rubygems/source.rb +15 -15
  175. data/lib/rubygems/spec_fetcher.rb +8 -8
  176. data/lib/rubygems/specification.rb +37 -38
  177. data/lib/rubygems/specification_policy.rb +13 -13
  178. data/lib/rubygems/stub_specification.rb +5 -5
  179. data/lib/rubygems/tsort.rb +1 -1
  180. data/lib/rubygems/uninstaller.rb +14 -14
  181. data/lib/rubygems/uri.rb +4 -4
  182. data/lib/rubygems/uri_formatter.rb +1 -1
  183. data/lib/rubygems/user_interaction.rb +31 -17
  184. data/lib/rubygems/util/licenses.rb +3 -3
  185. data/lib/rubygems/util.rb +10 -10
  186. data/lib/rubygems/validator.rb +5 -5
  187. data/lib/rubygems/version.rb +3 -5
  188. data/lib/rubygems/version_option.rb +3 -3
  189. data/lib/rubygems.rb +59 -58
  190. data/rubygems-update.gemspec +2 -2
  191. data/setup.rb +9 -9
  192. data/test/rubygems/helper.rb +127 -127
  193. data/test/rubygems/installer_test_case.rb +13 -13
  194. data/test/rubygems/package/tar_test_case.rb +2 -2
  195. data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
  196. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
  197. data/test/rubygems/rubygems_plugin.rb +2 -2
  198. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +4 -4
  199. data/test/rubygems/test_bundled_ca.rb +10 -10
  200. data/test/rubygems/test_config.rb +3 -3
  201. data/test/rubygems/test_deprecate.rb +3 -3
  202. data/test/rubygems/test_exit.rb +2 -2
  203. data/test/rubygems/test_gem.rb +342 -342
  204. data/test/rubygems/test_gem_available_set.rb +21 -21
  205. data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
  206. data/test/rubygems/test_gem_command.rb +44 -44
  207. data/test/rubygems/test_gem_command_manager.rb +29 -29
  208. data/test/rubygems/test_gem_commands_build_command.rb +63 -63
  209. data/test/rubygems/test_gem_commands_cert_command.rb +97 -99
  210. data/test/rubygems/test_gem_commands_check_command.rb +4 -4
  211. data/test/rubygems/test_gem_commands_cleanup_command.rb +40 -40
  212. data/test/rubygems/test_gem_commands_contents_command.rb +27 -27
  213. data/test/rubygems/test_gem_commands_dependency_command.rb +36 -36
  214. data/test/rubygems/test_gem_commands_environment_command.rb +16 -16
  215. data/test/rubygems/test_gem_commands_fetch_command.rb +37 -37
  216. data/test/rubygems/test_gem_commands_generate_index_command.rb +7 -7
  217. data/test/rubygems/test_gem_commands_help_command.rb +13 -13
  218. data/test/rubygems/test_gem_commands_info_command.rb +2 -2
  219. data/test/rubygems/test_gem_commands_install_command.rb +131 -131
  220. data/test/rubygems/test_gem_commands_list_command.rb +4 -4
  221. data/test/rubygems/test_gem_commands_lock_command.rb +10 -10
  222. data/test/rubygems/test_gem_commands_mirror.rb +2 -2
  223. data/test/rubygems/test_gem_commands_open_command.rb +4 -4
  224. data/test/rubygems/test_gem_commands_outdated_command.rb +9 -9
  225. data/test/rubygems/test_gem_commands_owner_command.rb +41 -41
  226. data/test/rubygems/test_gem_commands_pristine_command.rb +92 -92
  227. data/test/rubygems/test_gem_commands_push_command.rb +54 -54
  228. data/test/rubygems/test_gem_commands_query_command.rb +73 -73
  229. data/test/rubygems/test_gem_commands_search_command.rb +2 -2
  230. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  231. data/test/rubygems/test_gem_commands_setup_command.rb +119 -85
  232. data/test/rubygems/test_gem_commands_signin_command.rb +45 -31
  233. data/test/rubygems/test_gem_commands_signout_command.rb +3 -3
  234. data/test/rubygems/test_gem_commands_sources_command.rb +28 -29
  235. data/test/rubygems/test_gem_commands_specification_command.rb +32 -32
  236. data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
  237. data/test/rubygems/test_gem_commands_uninstall_command.rb +75 -75
  238. data/test/rubygems/test_gem_commands_unpack_command.rb +31 -31
  239. data/test/rubygems/test_gem_commands_update_command.rb +89 -89
  240. data/test/rubygems/test_gem_commands_which_command.rb +6 -6
  241. data/test/rubygems/test_gem_commands_yank_command.rb +40 -40
  242. data/test/rubygems/test_gem_config_file.rb +77 -77
  243. data/test/rubygems/test_gem_dependency.rb +73 -73
  244. data/test/rubygems/test_gem_dependency_installer.rb +165 -165
  245. data/test/rubygems/test_gem_dependency_list.rb +47 -47
  246. data/test/rubygems/test_gem_dependency_resolution_error.rb +4 -4
  247. data/test/rubygems/test_gem_doctor.rb +26 -26
  248. data/test/rubygems/test_gem_ext_builder.rb +59 -59
  249. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +6 -6
  250. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  251. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +8 -8
  252. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +1 -1
  253. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +6 -6
  254. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  255. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +8 -8
  256. data/test/rubygems/test_gem_ext_cargo_builder.rb +26 -26
  257. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +3 -3
  258. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +23 -23
  259. data/test/rubygems/test_gem_ext_cmake_builder.rb +15 -15
  260. data/test/rubygems/test_gem_ext_configure_builder.rb +13 -13
  261. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +51 -52
  262. data/test/rubygems/test_gem_ext_rake_builder.rb +15 -15
  263. data/test/rubygems/test_gem_gem_runner.rb +7 -7
  264. data/test/rubygems/test_gem_gemcutter_utilities.rb +66 -66
  265. data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -4
  266. data/test/rubygems/test_gem_indexer.rb +48 -48
  267. data/test/rubygems/test_gem_install_update_options.rb +16 -16
  268. data/test/rubygems/test_gem_installer.rb +297 -297
  269. data/test/rubygems/test_gem_local_remote_options.rb +10 -10
  270. data/test/rubygems/test_gem_name_tuple.rb +4 -4
  271. data/test/rubygems/test_gem_package.rb +206 -206
  272. data/test/rubygems/test_gem_package_old.rb +13 -13
  273. data/test/rubygems/test_gem_package_tar_header.rb +42 -42
  274. data/test/rubygems/test_gem_package_tar_reader.rb +7 -7
  275. data/test/rubygems/test_gem_package_tar_reader_entry.rb +10 -10
  276. data/test/rubygems/test_gem_package_tar_writer.rb +76 -76
  277. data/test/rubygems/test_gem_package_task.rb +18 -18
  278. data/test/rubygems/test_gem_path_support.rb +14 -14
  279. data/test/rubygems/test_gem_platform.rb +227 -227
  280. data/test/rubygems/test_gem_rdoc.rb +14 -14
  281. data/test/rubygems/test_gem_remote_fetcher.rb +149 -149
  282. data/test/rubygems/test_gem_request.rb +55 -55
  283. data/test/rubygems/test_gem_request_connection_pools.rb +29 -29
  284. data/test/rubygems/test_gem_request_set.rb +99 -99
  285. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +204 -206
  286. data/test/rubygems/test_gem_request_set_lockfile.rb +86 -86
  287. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +56 -56
  288. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +62 -62
  289. data/test/rubygems/test_gem_requirement.rb +38 -38
  290. data/test/rubygems/test_gem_resolver.rb +98 -98
  291. data/test/rubygems/test_gem_resolver_activation_request.rb +6 -6
  292. data/test/rubygems/test_gem_resolver_api_set.rb +33 -33
  293. data/test/rubygems/test_gem_resolver_api_specification.rb +47 -47
  294. data/test/rubygems/test_gem_resolver_best_set.rb +22 -22
  295. data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
  296. data/test/rubygems/test_gem_resolver_conflict.rb +12 -12
  297. data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -15
  298. data/test/rubygems/test_gem_resolver_git_set.rb +21 -21
  299. data/test/rubygems/test_gem_resolver_git_specification.rb +21 -21
  300. data/test/rubygems/test_gem_resolver_index_set.rb +12 -12
  301. data/test/rubygems/test_gem_resolver_index_specification.rb +15 -15
  302. data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -5
  303. data/test/rubygems/test_gem_resolver_installer_set.rb +34 -34
  304. data/test/rubygems/test_gem_resolver_local_specification.rb +7 -7
  305. data/test/rubygems/test_gem_resolver_lock_set.rb +12 -12
  306. data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -17
  307. data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
  308. data/test/rubygems/test_gem_resolver_specification.rb +8 -8
  309. data/test/rubygems/test_gem_resolver_vendor_set.rb +6 -6
  310. data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -10
  311. data/test/rubygems/test_gem_security.rb +67 -67
  312. data/test/rubygems/test_gem_security_policy.rb +62 -62
  313. data/test/rubygems/test_gem_security_signer.rb +28 -28
  314. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  315. data/test/rubygems/test_gem_silent_ui.rb +38 -32
  316. data/test/rubygems/test_gem_source.rb +44 -44
  317. data/test/rubygems/test_gem_source_fetch_problem.rb +9 -9
  318. data/test/rubygems/test_gem_source_git.rb +59 -59
  319. data/test/rubygems/test_gem_source_installed.rb +16 -16
  320. data/test/rubygems/test_gem_source_list.rb +5 -5
  321. data/test/rubygems/test_gem_source_local.rb +14 -14
  322. data/test/rubygems/test_gem_source_lock.rb +31 -31
  323. data/test/rubygems/test_gem_source_specific_file.rb +17 -17
  324. data/test/rubygems/test_gem_source_subpath_problem.rb +7 -7
  325. data/test/rubygems/test_gem_source_vendor.rb +13 -13
  326. data/test/rubygems/test_gem_spec_fetcher.rb +72 -72
  327. data/test/rubygems/test_gem_specification.rb +434 -435
  328. data/test/rubygems/test_gem_stream_ui.rb +19 -19
  329. data/test/rubygems/test_gem_stub_specification.rb +32 -32
  330. data/test/rubygems/test_gem_text.rb +1 -1
  331. data/test/rubygems/test_gem_uninstaller.rb +112 -112
  332. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -3
  333. data/test/rubygems/test_gem_uri.rb +4 -4
  334. data/test/rubygems/test_gem_uri_formatter.rb +14 -14
  335. data/test/rubygems/test_gem_util.rb +23 -23
  336. data/test/rubygems/test_gem_validator.rb +8 -8
  337. data/test/rubygems/test_gem_version.rb +13 -13
  338. data/test/rubygems/test_gem_version_option.rb +15 -15
  339. data/test/rubygems/test_kernel.rb +31 -31
  340. data/test/rubygems/test_project_sanity.rb +1 -1
  341. data/test/rubygems/test_remote_fetch_error.rb +6 -6
  342. data/test/rubygems/test_require.rb +42 -42
  343. data/test/rubygems/test_rubygems.rb +8 -8
  344. data/test/rubygems/utilities.rb +17 -17
  345. metadata +4 -3
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
- require 'benchmark'
3
- require_relative 'helper'
4
- require 'date'
5
- require 'pathname'
6
- require 'stringio'
7
- require 'rubygems/ext'
8
- require 'rubygems/specification'
9
- require 'rubygems/installer'
10
- require 'rubygems/platform'
2
+ require "benchmark"
3
+ require_relative "helper"
4
+ require "date"
5
+ require "pathname"
6
+ require "stringio"
7
+ require "rubygems/ext"
8
+ require "rubygems/specification"
9
+ require "rubygems/installer"
10
+ require "rubygems/platform"
11
11
 
12
12
  class TestGemSpecification < Gem::TestCase
13
13
  LEGACY_YAML_SPEC = <<-EOF.freeze
@@ -44,16 +44,16 @@ end
44
44
  EOF
45
45
 
46
46
  def make_spec_c1
47
- @c1 = util_spec 'a', '1' do |s|
48
- s.executable = 'exec'
49
- s.extensions << 'ext/a/extconf.rb'
50
- s.test_file = 'test/suite.rb'
51
- s.requirements << 'A working computer'
52
- s.license = 'MIT'
47
+ @c1 = util_spec "a", "1" do |s|
48
+ s.executable = "exec"
49
+ s.extensions << "ext/a/extconf.rb"
50
+ s.test_file = "test/suite.rb"
51
+ s.requirements << "A working computer"
52
+ s.license = "MIT"
53
53
 
54
- s.add_dependency 'rake', '> 0.4'
55
- s.add_dependency 'jabber4r', '> 0.0.0'
56
- s.add_dependency 'pqa', ['> 0.4', '<= 0.6']
54
+ s.add_dependency "rake", "> 0.4"
55
+ s.add_dependency "jabber4r", "> 0.0.0"
56
+ s.add_dependency "pqa", ["> 0.4", "<= 0.6"]
57
57
 
58
58
  s.mark_version
59
59
  s.files = %w[lib/code.rb]
@@ -61,16 +61,16 @@ end
61
61
  end
62
62
 
63
63
  def ext_spec(platform: Gem::Platform::RUBY)
64
- @ext = util_spec 'ext', '1' do |s|
65
- s.executable = 'exec'
66
- s.test_file = 'test/suite.rb'
64
+ @ext = util_spec "ext", "1" do |s|
65
+ s.executable = "exec"
66
+ s.test_file = "test/suite.rb"
67
67
  s.extensions = %w[ext/extconf.rb]
68
- s.license = 'MIT'
68
+ s.license = "MIT"
69
69
  s.platform = platform
70
70
 
71
71
  s.mark_version
72
72
  s.files = %w[lib/code.rb]
73
- s.installed_by_version = v('2.2')
73
+ s.installed_by_version = v("2.2")
74
74
  end
75
75
  end
76
76
 
@@ -88,40 +88,40 @@ end
88
88
  # is not set.
89
89
  Gem.instance_variable_set(:'@default_source_date_epoch', nil)
90
90
 
91
- @a1 = util_spec 'a', '1' do |s|
92
- s.executable = 'exec'
93
- s.test_file = 'test/suite.rb'
94
- s.requirements << 'A working computer'
95
- s.license = 'MIT'
91
+ @a1 = util_spec "a", "1" do |s|
92
+ s.executable = "exec"
93
+ s.test_file = "test/suite.rb"
94
+ s.requirements << "A working computer"
95
+ s.license = "MIT"
96
96
 
97
97
  s.mark_version
98
98
  s.files = %w[lib/code.rb]
99
99
  end
100
100
 
101
- @a2 = util_spec 'a', '2' do |s|
101
+ @a2 = util_spec "a", "2" do |s|
102
102
  s.files = %w[lib/code.rb]
103
103
  end
104
104
 
105
- @a3 = util_spec 'a', '3' do |s|
106
- s.metadata['allowed_push_host'] = "https://privategemserver.com"
105
+ @a3 = util_spec "a", "3" do |s|
106
+ s.metadata["allowed_push_host"] = "https://privategemserver.com"
107
107
  end
108
108
 
109
109
  @current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
110
110
  end
111
111
 
112
112
  def test_self_find_active_stub_by_path
113
- spec = util_spec('a', '1', nil, 'lib/foo.rb')
113
+ spec = util_spec("a", "1", nil, "lib/foo.rb")
114
114
  spec.activated = true
115
115
 
116
116
  # There used to be a bug (introduced in a9c1aaf) when Gem::Specification
117
117
  # objects are present in the @stubs collection. This test verifies that
118
118
  # this scenario works correctly.
119
119
  Gem::Specification.all = [spec]
120
- assert_equal spec, Gem::Specification.find_active_stub_by_path('foo')
120
+ assert_equal spec, Gem::Specification.find_active_stub_by_path("foo")
121
121
  end
122
122
 
123
123
  def test_self_activate
124
- foo = util_spec 'foo', '1'
124
+ foo = util_spec "foo", "1"
125
125
 
126
126
  assert_activate %w[foo-1], foo
127
127
  end
@@ -147,7 +147,7 @@ end
147
147
  end
148
148
 
149
149
  def test_find_in_unresolved_tree_is_not_exponentiental
150
- pend "currently slower in CI on TruffleRuby" if RUBY_ENGINE == 'truffleruby'
150
+ pend "currently slower in CI on TruffleRuby" if RUBY_ENGINE == "truffleruby"
151
151
  num_of_pkg = 7
152
152
  num_of_version_per_pkg = 3
153
153
  packages = (0..num_of_pkg).map do |pkgi|
@@ -166,7 +166,7 @@ end
166
166
  base.activate
167
167
 
168
168
  tms = Benchmark.measure do
169
- assert_raise(LoadError) { require 'no_such_file_foo' }
169
+ assert_raise(LoadError) { require "no_such_file_foo" }
170
170
  end
171
171
  assert_operator tms.total, :<=, 10
172
172
  end
@@ -372,13 +372,13 @@ end
372
372
  # [B] ~> 1.0 (satisfied by 1.0)
373
373
 
374
374
  def test_self_activate_checks_dependencies
375
- a = util_spec 'a', '1.0'
376
- a.add_dependency 'c', '= 1.0'
377
- a.add_dependency 'b', '~> 1.0'
375
+ a = util_spec "a", "1.0"
376
+ a.add_dependency "c", "= 1.0"
377
+ a.add_dependency "b", "~> 1.0"
378
378
 
379
- b1 = util_spec 'b', '1.0'
380
- b2 = util_spec 'b', '2.0'
381
- c = util_spec 'c', '1.0', 'b' => '= 2.0'
379
+ b1 = util_spec "b", "1.0"
380
+ b2 = util_spec "b", "2.0"
381
+ c = util_spec "c", "1.0", "b" => "= 2.0"
382
382
  install_specs b1, b2, c, a
383
383
 
384
384
  e = assert_raise Gem::LoadError do
@@ -396,10 +396,10 @@ end
396
396
  # [B] = 2.0
397
397
 
398
398
  def test_self_activate_divergent
399
- a = util_spec 'a', '1.0', 'b' => '~> 1.0', 'c' => '= 1.0'
400
- b1 = util_spec 'b', '1.0'
401
- b2 = util_spec 'b', '2.0'
402
- c = util_spec 'c', '1.0', 'b' => '= 2.0'
399
+ a = util_spec "a", "1.0", "b" => "~> 1.0", "c" => "= 1.0"
400
+ b1 = util_spec "b", "1.0"
401
+ b2 = util_spec "b", "2.0"
402
+ c = util_spec "c", "1.0", "b" => "= 2.0"
403
403
 
404
404
  install_specs b1, b2, c, a
405
405
 
@@ -415,9 +415,9 @@ end
415
415
  # DOC
416
416
 
417
417
  def test_self_activate_old_required
418
- e1, = util_spec 'e', '1', 'd' => '= 1'
419
- @d1 = util_spec 'd', '1'
420
- @d2 = util_spec 'd', '2'
418
+ e1, = util_spec "e", "1", "d" => "= 1"
419
+ @d1 = util_spec "d", "1"
420
+ @d2 = util_spec "d", "2"
421
421
 
422
422
  install_specs @d1, @d2, e1
423
423
 
@@ -428,17 +428,17 @@ end
428
428
  # DOC
429
429
 
430
430
  def test_self_activate_platform_alternate
431
- @x1_m = util_spec 'x', '1' do |s|
431
+ @x1_m = util_spec "x", "1" do |s|
432
432
  s.platform = Gem::Platform.new %w[cpu my_platform 1]
433
433
  end
434
434
 
435
- @x1_o = util_spec 'x', '1' do |s|
435
+ @x1_o = util_spec "x", "1" do |s|
436
436
  s.platform = Gem::Platform.new %w[cpu other_platform 1]
437
437
  end
438
438
 
439
- @w1 = util_spec 'w', '1', 'x' => nil
439
+ @w1 = util_spec "w", "1", "x" => nil
440
440
 
441
- util_set_arch 'cpu-my_platform1'
441
+ util_set_arch "cpu-my_platform1"
442
442
  install_specs @x1_m, @x1_o, @w1
443
443
 
444
444
  assert_activate %w[x-1-cpu-my_platform-1 w-1], @w1, @x1_m
@@ -448,13 +448,13 @@ end
448
448
  # DOC
449
449
 
450
450
  def test_self_activate_platform_bump
451
- @y1 = util_spec 'y', '1'
451
+ @y1 = util_spec "y", "1"
452
452
 
453
- @y1_1_p = util_spec 'y', '1.1' do |s|
453
+ @y1_1_p = util_spec "y", "1.1" do |s|
454
454
  s.platform = Gem::Platform.new %w[cpu my_platform 1]
455
455
  end
456
456
 
457
- @z1 = util_spec 'z', '1', 'y' => nil
457
+ @z1 = util_spec "z", "1", "y" => nil
458
458
  install_specs @y1, @y1_1_p, @z1
459
459
 
460
460
  assert_activate %w[y-1 z-1], @z1, @y1
@@ -467,11 +467,11 @@ end
467
467
  # [A] >= 0 (satisfied by 1.a)
468
468
 
469
469
  def test_self_activate_prerelease
470
- @c1_pre = util_spec 'c', '1.a', "a" => "1.a", "b" => "1"
471
- @a1_pre = util_spec 'a', '1.a'
472
- @b1 = util_spec 'b', '1' do |s|
473
- s.add_dependency 'a'
474
- s.add_development_dependency 'aa'
470
+ @c1_pre = util_spec "c", "1.a", "a" => "1.a", "b" => "1"
471
+ @a1_pre = util_spec "a", "1.a"
472
+ @b1 = util_spec "b", "1" do |s|
473
+ s.add_dependency "a"
474
+ s.add_development_dependency "aa"
475
475
  end
476
476
  install_specs @a1_pre, @b1, @c1_pre
477
477
 
@@ -533,7 +533,7 @@ end
533
533
  end
534
534
 
535
535
  def test_self_activate_loaded
536
- foo = util_spec 'foo', '1'
536
+ foo = util_spec "foo", "1"
537
537
 
538
538
  assert foo.activate
539
539
  refute foo.activate
@@ -545,9 +545,9 @@ end
545
545
  # [C] depends on nothing
546
546
 
547
547
  def test_self_activate_unrelated
548
- a = util_spec 'a', '1.0', 'b' => '>= 1.0'
549
- b = util_spec 'b', '1.0'
550
- c = util_spec 'c', '1.0'
548
+ a = util_spec "a", "1.0", "b" => ">= 1.0"
549
+ b = util_spec "b", "1.0"
550
+ c = util_spec "c", "1.0"
551
551
  install_specs b, c, a
552
552
 
553
553
  assert_activate %w[b-1.0 c-1.0 a-1.0], a, c, "b"
@@ -563,11 +563,11 @@ end
563
563
  # TODO: move these to specification
564
564
 
565
565
  def test_self_activate_over
566
- a = util_spec 'a', '1.0', 'b' => '>= 1.0', 'c' => '= 1.0'
567
- install_specs util_spec 'b', '1.0'
568
- install_specs util_spec 'b', '1.1'
569
- install_specs util_spec 'b', '2.0'
570
- install_specs util_spec 'c', '1.0', 'b' => '~> 1.0'
566
+ a = util_spec "a", "1.0", "b" => ">= 1.0", "c" => "= 1.0"
567
+ install_specs util_spec "b", "1.0"
568
+ install_specs util_spec "b", "1.1"
569
+ install_specs util_spec "b", "2.0"
570
+ install_specs util_spec "c", "1.0", "b" => "~> 1.0"
571
571
  install_specs a
572
572
 
573
573
  a.activate
@@ -588,10 +588,10 @@ end
588
588
  # first resolve through a dependency that is later pruned.
589
589
 
590
590
  def test_self_activate_under
591
- a = util_spec 'a', '1.0', 'b' => '~> 1.0', 'c' => '= 1.0'
592
- b1 = util_spec 'b', '1.0'
593
- b1_1 = util_spec 'b', '1.1'
594
- c = util_spec 'c', '1.0', 'b' => '= 1.0'
591
+ a = util_spec "a", "1.0", "b" => "~> 1.0", "c" => "= 1.0"
592
+ b1 = util_spec "b", "1.0"
593
+ b1_1 = util_spec "b", "1.1"
594
+ c = util_spec "c", "1.0", "b" => "= 1.0"
595
595
 
596
596
  install_specs b1, b1_1, c, a
597
597
 
@@ -607,10 +607,10 @@ end
607
607
  # [C1] depends on nothing
608
608
 
609
609
  def test_self_activate_dropped
610
- a1 = util_spec 'a', '1', 'b' => nil
611
- b1 = util_spec 'b', '1', 'c' => nil
612
- b2 = util_spec 'b', '2'
613
- c1 = util_spec 'c', '1'
610
+ a1 = util_spec "a", "1", "b" => nil
611
+ b1 = util_spec "b", "1", "c" => nil
612
+ b2 = util_spec "b", "2"
613
+ c1 = util_spec "c", "1"
614
614
  install_specs c1, b1, b2, a1
615
615
 
616
616
  assert_activate %w[b-2 a-1], a1, "b"
@@ -627,11 +627,11 @@ end
627
627
  # resolve.
628
628
 
629
629
  def test_self_activate_raggi_the_edgecase_generator
630
- a = util_spec 'a', '1.0', 'b' => '>= 1.0', 'c' => '>= 1.0'
631
- b1 = util_spec 'b', '1.0'
632
- b1_0 = util_spec 'b', '1.1', 'z' => '>= 1.0'
633
- c = util_spec 'c', '1.0', 'b' => '= 1.0'
634
- z = util_spec 'z', '1'
630
+ a = util_spec "a", "1.0", "b" => ">= 1.0", "c" => ">= 1.0"
631
+ b1 = util_spec "b", "1.0"
632
+ b1_0 = util_spec "b", "1.1", "z" => ">= 1.0"
633
+ c = util_spec "c", "1.0", "b" => "= 1.0"
634
+ z = util_spec "z", "1"
635
635
 
636
636
  install_specs z, b1, b1_0, c, z
637
637
 
@@ -639,8 +639,8 @@ end
639
639
  end
640
640
 
641
641
  def test_self_activate_conflict
642
- install_specs util_spec 'b', '1.0'
643
- install_specs util_spec 'b', '2.0'
642
+ install_specs util_spec "b", "1.0"
643
+ install_specs util_spec "b", "2.0"
644
644
 
645
645
  gem "b", "= 1.0"
646
646
 
@@ -655,7 +655,7 @@ end
655
655
  install_specs a
656
656
  Gem::Specification.all = [a]
657
657
 
658
- assert_equal a, Gem::Specification.find_inactive_by_path('foo')
658
+ assert_equal a, Gem::Specification.find_inactive_by_path("foo")
659
659
  end
660
660
 
661
661
  def test_self_attribute_names
@@ -698,13 +698,13 @@ end
698
698
 
699
699
  def test_self__load_future
700
700
  spec = Gem::Specification.new
701
- spec.name = 'a'
702
- spec.version = '1'
701
+ spec.name = "a"
702
+ spec.version = "1"
703
703
  spec.specification_version = @current_version + 1
704
704
 
705
705
  load_spec = Marshal.load Marshal.dump(spec)
706
706
 
707
- assert_equal 'a', load_spec.name
707
+ assert_equal "a", load_spec.name
708
708
  assert_equal Gem::Version.new(1), load_spec.version
709
709
  assert_equal @current_version, load_spec.specification_version
710
710
  end
@@ -783,20 +783,20 @@ dependencies: []
783
783
  end
784
784
 
785
785
  def test_self_load_relative
786
- File.open 'a-2.gemspec', 'w' do |io|
786
+ File.open "a-2.gemspec", "w" do |io|
787
787
  io.write @a2.to_ruby_for_cache
788
788
  end
789
789
 
790
- spec = Gem::Specification.load 'a-2.gemspec'
790
+ spec = Gem::Specification.load "a-2.gemspec"
791
791
 
792
792
  @a2.files.clear
793
793
 
794
794
  assert_equal @a2, spec
795
795
 
796
- assert_equal File.join(@tempdir, 'a-2.gemspec'), spec.loaded_from
796
+ assert_equal File.join(@tempdir, "a-2.gemspec"), spec.loaded_from
797
797
  end
798
798
 
799
- if RUBY_ENGINE == 'ruby' and RUBY_VERSION < '2.7'
799
+ if RUBY_ENGINE == "ruby" and RUBY_VERSION < "2.7"
800
800
  def test_self_load_tainted
801
801
  full_path = @a2.spec_file
802
802
  write_file full_path do |io|
@@ -874,13 +874,13 @@ dependencies: []
874
874
  end
875
875
 
876
876
  def test_self_load_utf8_with_ascii_encoding
877
- with_internal_encoding('US-ASCII') do
877
+ with_internal_encoding("US-ASCII") do
878
878
  spec2 = @a2.dup
879
879
  bin = "\u5678".dup
880
880
  spec2.authors = [bin]
881
881
  full_path = spec2.spec_file
882
882
  write_file full_path do |io|
883
- io.write spec2.to_ruby_for_cache.force_encoding('BINARY').sub("\\u{5678}", bin.force_encoding('BINARY'))
883
+ io.write spec2.to_ruby_for_cache.force_encoding("BINARY").sub("\\u{5678}", bin.force_encoding("BINARY"))
884
884
  end
885
885
 
886
886
  spec = Gem::Specification.load full_path
@@ -895,10 +895,10 @@ dependencies: []
895
895
  spec = Gem::Deprecate.skip_during do
896
896
  eval LEGACY_RUBY_SPEC
897
897
  end
898
- assert_equal 'keyedlist', spec.name
899
- assert_equal '0.4.0', spec.version.to_s
898
+ assert_equal "keyedlist", spec.name
899
+ assert_equal "0.4.0", spec.version.to_s
900
900
  assert_kind_of Time, spec.date
901
- assert spec.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
901
+ assert spec.required_ruby_version.satisfied_by?(Gem::Version.new("1"))
902
902
  assert_equal false, spec.has_unit_tests?
903
903
  end
904
904
 
@@ -933,9 +933,9 @@ dependencies: []
933
933
 
934
934
  def test_self_outdated
935
935
  spec_fetcher do |fetcher|
936
- fetcher.download 'a', 4
936
+ fetcher.download "a", 4
937
937
 
938
- fetcher.spec 'a', 3
938
+ fetcher.spec "a", 3
939
939
  end
940
940
 
941
941
  assert_equal %w[a], Gem::Specification.outdated
@@ -943,16 +943,16 @@ dependencies: []
943
943
 
944
944
  def test_self_outdated_and_latest_remotes
945
945
  spec_fetcher do |fetcher|
946
- fetcher.download 'a', 4
947
- fetcher.download 'b', 3
946
+ fetcher.download "a", 4
947
+ fetcher.download "b", 3
948
948
 
949
- fetcher.spec 'a', '3.a'
950
- fetcher.spec 'b', 2
949
+ fetcher.spec "a", "3.a"
950
+ fetcher.spec "b", 2
951
951
  end
952
952
 
953
953
  expected = [
954
- [Gem::Specification.stubs.find {|s| s.full_name == 'a-3.a' }, v(4)],
955
- [Gem::Specification.stubs.find {|s| s.full_name == 'b-2' }, v(3)],
954
+ [Gem::Specification.stubs.find {|s| s.full_name == "a-3.a" }, v(4)],
955
+ [Gem::Specification.stubs.find {|s| s.full_name == "b-2" }, v(3)],
956
956
  ]
957
957
 
958
958
  assert_equal expected, Gem::Specification.outdated_and_latest_version.to_a
@@ -961,18 +961,18 @@ dependencies: []
961
961
  def test_self_remove_spec
962
962
  install_specs @a1
963
963
 
964
- assert_includes Gem::Specification.all_names, 'a-1'
965
- assert_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
964
+ assert_includes Gem::Specification.all_names, "a-1"
965
+ assert_includes Gem::Specification.stubs.map {|s| s.full_name }, "a-1"
966
966
 
967
967
  uninstall_gem @a1
968
968
  Gem::Specification.reset
969
969
 
970
- refute_includes Gem::Specification.all_names, 'a-1'
971
- refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
970
+ refute_includes Gem::Specification.all_names, "a-1"
971
+ refute_includes Gem::Specification.stubs.map {|s| s.full_name }, "a-1"
972
972
  end
973
973
 
974
974
  def test_self_remove_spec_removed
975
- File.open @a1.spec_file, 'w' do |io|
975
+ File.open @a1.spec_file, "w" do |io|
976
976
  io.write @a1.to_ruby
977
977
  end
978
978
 
@@ -982,40 +982,40 @@ dependencies: []
982
982
 
983
983
  Gem::Specification.reset
984
984
 
985
- refute_includes Gem::Specification.all_names, 'a-1'
986
- refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
985
+ refute_includes Gem::Specification.all_names, "a-1"
986
+ refute_includes Gem::Specification.stubs.map {|s| s.full_name }, "a-1"
987
987
  end
988
988
 
989
989
  def test_self_stubs_for_lazy_loading
990
990
  Gem.loaded_specs.clear
991
991
  Gem::Specification.class_variable_set(:@@stubs, nil)
992
992
 
993
- dir_standard_specs = File.join Gem.dir, 'specifications'
993
+ dir_standard_specs = File.join Gem.dir, "specifications"
994
994
 
995
- save_gemspec('a-1', '1', dir_standard_specs) {|s| s.name = 'a' }
996
- save_gemspec('b-1', '1', dir_standard_specs) {|s| s.name = 'b' }
995
+ save_gemspec("a-1", "1", dir_standard_specs) {|s| s.name = "a" }
996
+ save_gemspec("b-1", "1", dir_standard_specs) {|s| s.name = "b" }
997
997
 
998
- assert_equal ['a-1'], Gem::Specification.stubs_for('a').map {|s| s.full_name }
998
+ assert_equal ["a-1"], Gem::Specification.stubs_for("a").map {|s| s.full_name }
999
999
  assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length
1000
- assert_equal ['b-1'], Gem::Specification.stubs_for('b').map {|s| s.full_name }
1000
+ assert_equal ["b-1"], Gem::Specification.stubs_for("b").map {|s| s.full_name }
1001
1001
  assert_equal 2, Gem::Specification.class_variable_get(:@@stubs_by_name).length
1002
1002
 
1003
1003
  assert_equal(
1004
- Gem::Specification.stubs_for('a').map {|s| s.object_id },
1005
- Gem::Specification.stubs_for('a').map {|s| s.object_id }
1004
+ Gem::Specification.stubs_for("a").map {|s| s.object_id },
1005
+ Gem::Specification.stubs_for("a").map {|s| s.object_id }
1006
1006
  )
1007
1007
 
1008
- Gem.loaded_specs.delete 'a'
1009
- Gem.loaded_specs.delete 'b'
1008
+ Gem.loaded_specs.delete "a"
1009
+ Gem.loaded_specs.delete "b"
1010
1010
  Gem::Specification.class_variable_set(:@@stubs, nil)
1011
1011
  end
1012
1012
 
1013
1013
  def test_self_stubs_for_no_lazy_loading_after_all_specs_setup
1014
- Gem::Specification.all = [util_spec('a', '1')]
1014
+ Gem::Specification.all = [util_spec("a", "1")]
1015
1015
 
1016
- save_gemspec('b-1', '1', File.join(Gem.dir, 'specifications')) {|s| s.name = 'b' }
1016
+ save_gemspec("b-1", "1", File.join(Gem.dir, "specifications")) {|s| s.name = "b" }
1017
1017
 
1018
- assert_equal [], Gem::Specification.stubs_for('b').map {|s| s.full_name }
1018
+ assert_equal [], Gem::Specification.stubs_for("b").map {|s| s.full_name }
1019
1019
  end
1020
1020
 
1021
1021
  def test_self_stubs_for_mult_platforms
@@ -1025,30 +1025,30 @@ dependencies: []
1025
1025
  orig_platform = Gem.platforms.dup
1026
1026
 
1027
1027
  # create user spec
1028
- user_spec_dir = File.join Gem.user_dir, 'specifications'
1028
+ user_spec_dir = File.join Gem.user_dir, "specifications"
1029
1029
  FileUtils.mkdir_p(user_spec_dir) unless Dir.exist? user_spec_dir
1030
1030
  # dirs doesn't include user ?
1031
1031
  Gem::Specification.dirs << user_spec_dir
1032
1032
 
1033
- gem = 'mingw'
1034
- v = '1.1.1'
1035
- platforms = ['x86-mingw32', 'x64-mingw32']
1033
+ gem = "mingw"
1034
+ v = "1.1.1"
1035
+ platforms = ["x86-mingw32", "x64-mingw32"]
1036
1036
 
1037
1037
  #create specs
1038
1038
  platforms.each do |plat|
1039
1039
  spec = Gem::Specification.new(gem, v) {|s| s.platform = plat }
1040
- File.open File.join(user_spec_dir, "#{gem}-#{v}-#{plat}.gemspec"), 'w' do |io|
1040
+ File.open File.join(user_spec_dir, "#{gem}-#{v}-#{plat}.gemspec"), "w" do |io|
1041
1041
  io.write spec.to_ruby
1042
1042
  end
1043
1043
  end
1044
1044
 
1045
1045
  platforms.each do |plat|
1046
1046
  cur_plat = Gem::Platform.new plat
1047
- Gem.platforms = ['ruby', cur_plat]
1047
+ Gem.platforms = ["ruby", cur_plat]
1048
1048
 
1049
1049
  Gem::Specification.class_variable_set :@@stubs, nil
1050
1050
  Gem::Specification.stubs if plat == platforms.last # test loading via stubs
1051
- t = Gem::Specification.stubs_for 'mingw'
1051
+ t = Gem::Specification.stubs_for "mingw"
1052
1052
 
1053
1053
  assert_equal 1, t.length
1054
1054
  assert_equal cur_plat, t.first.platform
@@ -1058,17 +1058,17 @@ dependencies: []
1058
1058
  end
1059
1059
 
1060
1060
  def test_self_stubs_returns_only_specified_named_specs
1061
- dir_standard_specs = File.join Gem.dir, 'specifications'
1061
+ dir_standard_specs = File.join Gem.dir, "specifications"
1062
1062
 
1063
- save_gemspec('a-1', '1', dir_standard_specs) {|s| s.name = 'a' }
1064
- save_gemspec('a-2', '2', dir_standard_specs) {|s| s.name = 'a' }
1065
- save_gemspec('a-a', '3', dir_standard_specs) {|s| s.name = 'a-a' }
1063
+ save_gemspec("a-1", "1", dir_standard_specs) {|s| s.name = "a" }
1064
+ save_gemspec("a-2", "2", dir_standard_specs) {|s| s.name = "a" }
1065
+ save_gemspec("a-a", "3", dir_standard_specs) {|s| s.name = "a-a" }
1066
1066
 
1067
- assert_equal ['a-1', 'a-2'], Gem::Specification.stubs_for('a').map(&:full_name).sort
1067
+ assert_equal ["a-1", "a-2"], Gem::Specification.stubs_for("a").map(&:full_name).sort
1068
1068
  end
1069
1069
 
1070
1070
  def test_handles_private_null_type
1071
- path = File.expand_path 'data/pry-0.4.7.gemspec.rz', __dir__
1071
+ path = File.expand_path "data/pry-0.4.7.gemspec.rz", __dir__
1072
1072
 
1073
1073
  data = Marshal.load Gem::Util.inflate(Gem.read_binary(path))
1074
1074
 
@@ -1076,7 +1076,7 @@ dependencies: []
1076
1076
  end
1077
1077
 
1078
1078
  def test_handles_dependencies_with_syck_requirements_bug
1079
- path = File.expand_path 'data/excon-0.7.7.gemspec.rz', __dir__
1079
+ path = File.expand_path "data/excon-0.7.7.gemspec.rz", __dir__
1080
1080
 
1081
1081
  data = Marshal.load Gem::Util.inflate(Gem.read_binary(path))
1082
1082
 
@@ -1102,9 +1102,9 @@ dependencies: []
1102
1102
  assert_equal [], spec.extensions
1103
1103
  assert_equal [], spec.requirements
1104
1104
  assert_equal [], spec.dependencies
1105
- assert_equal 'bin', spec.bindir
1106
- assert_equal '>= 0', spec.required_ruby_version.to_s
1107
- assert_equal '>= 0', spec.required_rubygems_version.to_s
1105
+ assert_equal "bin", spec.bindir
1106
+ assert_equal ">= 0", spec.required_ruby_version.to_s
1107
+ assert_equal ">= 0", spec.required_rubygems_version.to_s
1108
1108
  end
1109
1109
 
1110
1110
  def test_initialize_future
@@ -1126,18 +1126,18 @@ dependencies: []
1126
1126
  spec = Gem::Specification.new do |s|
1127
1127
  s.name = "blah"
1128
1128
  s.version = "1.3.5"
1129
- s.summary = 'summary'
1130
- s.description = 'description'
1131
- s.authors = 'author a', 'author b'
1132
- s.licenses = 'BSD-2-Clause'
1133
- s.files = 'lib/file.rb'
1134
- s.test_files = 'test/file.rb'
1135
- s.rdoc_options = '--foo'
1136
- s.extra_rdoc_files = 'README.txt'
1137
- s.executables = 'exec'
1138
- s.extensions = 'ext/extconf.rb'
1139
- s.requirements = 'requirement'
1140
- s.add_dependency 'some_gem'
1129
+ s.summary = "summary"
1130
+ s.description = "description"
1131
+ s.authors = "author a", "author b"
1132
+ s.licenses = "BSD-2-Clause"
1133
+ s.files = "lib/file.rb"
1134
+ s.test_files = "test/file.rb"
1135
+ s.rdoc_options = "--foo"
1136
+ s.extra_rdoc_files = "README.txt"
1137
+ s.executables = "exec"
1138
+ s.extensions = "ext/extconf.rb"
1139
+ s.requirements = "requirement"
1140
+ s.add_dependency "some_gem"
1141
1141
  end
1142
1142
 
1143
1143
  dup_spec = spec.dup
@@ -1151,69 +1151,69 @@ dependencies: []
1151
1151
  assert_equal Gem::Platform::RUBY, spec.platform
1152
1152
  assert_same spec.platform, dup_spec.platform
1153
1153
 
1154
- assert_equal 'summary', spec.summary
1154
+ assert_equal "summary", spec.summary
1155
1155
  assert_same spec.summary, dup_spec.summary
1156
1156
 
1157
1157
  assert_equal %w[README.txt bin/exec ext/extconf.rb lib/file.rb
1158
1158
  test/file.rb].sort,
1159
1159
  spec.files
1160
- refute_same spec.files, dup_spec.files, 'files'
1160
+ refute_same spec.files, dup_spec.files, "files"
1161
1161
 
1162
1162
  assert_equal %w[test/file.rb], spec.test_files
1163
- refute_same spec.test_files, dup_spec.test_files, 'test_files'
1163
+ refute_same spec.test_files, dup_spec.test_files, "test_files"
1164
1164
 
1165
1165
  assert_equal %w[--foo], spec.rdoc_options
1166
- refute_same spec.rdoc_options, dup_spec.rdoc_options, 'rdoc_options'
1166
+ refute_same spec.rdoc_options, dup_spec.rdoc_options, "rdoc_options"
1167
1167
 
1168
1168
  assert_equal %w[README.txt], spec.extra_rdoc_files
1169
1169
  refute_same spec.extra_rdoc_files, dup_spec.extra_rdoc_files,
1170
- 'extra_rdoc_files'
1170
+ "extra_rdoc_files"
1171
1171
 
1172
1172
  assert_equal %w[exec], spec.executables
1173
- refute_same spec.executables, dup_spec.executables, 'executables'
1173
+ refute_same spec.executables, dup_spec.executables, "executables"
1174
1174
 
1175
1175
  assert_equal %w[ext/extconf.rb], spec.extensions
1176
- refute_same spec.extensions, dup_spec.extensions, 'extensions'
1176
+ refute_same spec.extensions, dup_spec.extensions, "extensions"
1177
1177
 
1178
1178
  assert_equal %w[requirement], spec.requirements
1179
- refute_same spec.requirements, dup_spec.requirements, 'requirements'
1179
+ refute_same spec.requirements, dup_spec.requirements, "requirements"
1180
1180
 
1181
- assert_equal [Gem::Dependency.new('some_gem', Gem::Requirement.default)],
1181
+ assert_equal [Gem::Dependency.new("some_gem", Gem::Requirement.default)],
1182
1182
  spec.dependencies
1183
- refute_same spec.dependencies, dup_spec.dependencies, 'dependencies'
1183
+ refute_same spec.dependencies, dup_spec.dependencies, "dependencies"
1184
1184
 
1185
- assert_equal 'bin', spec.bindir
1185
+ assert_equal "bin", spec.bindir
1186
1186
  assert_same spec.bindir, dup_spec.bindir
1187
1187
 
1188
- assert_equal '>= 0', spec.required_ruby_version.to_s
1188
+ assert_equal ">= 0", spec.required_ruby_version.to_s
1189
1189
  assert_same spec.required_ruby_version, dup_spec.required_ruby_version
1190
1190
 
1191
- assert_equal '>= 0', spec.required_rubygems_version.to_s
1191
+ assert_equal ">= 0", spec.required_rubygems_version.to_s
1192
1192
  assert_same spec.required_rubygems_version,
1193
1193
  dup_spec.required_rubygems_version
1194
1194
  end
1195
1195
 
1196
1196
  def test_initialize_copy_broken
1197
1197
  spec = Gem::Specification.new do |s|
1198
- s.name = 'a'
1199
- s.version = '1'
1198
+ s.name = "a"
1199
+ s.version = "1"
1200
1200
  end
1201
1201
 
1202
1202
  spec.instance_variable_set :@licenses, (class << (Object.new);self;end)
1203
- spec.loaded_from = '/path/to/file'
1203
+ spec.loaded_from = "/path/to/file"
1204
1204
 
1205
1205
  e = assert_raise Gem::FormatException do
1206
1206
  spec.dup
1207
1207
  end
1208
1208
 
1209
- assert_equal 'a-1 has an invalid value for @licenses', e.message
1210
- assert_equal '/path/to/file', e.file_path
1209
+ assert_equal "a-1 has an invalid value for @licenses", e.message
1210
+ assert_equal "/path/to/file", e.file_path
1211
1211
  end
1212
1212
 
1213
1213
  def test_initialize_prerelease_version_before_name
1214
1214
  spec = Gem::Specification.new do |s|
1215
- s.version = '1.0.0.dev'
1216
- s.name = 'a'
1215
+ s.version = "1.0.0.dev"
1216
+ s.name = "a"
1217
1217
  end
1218
1218
 
1219
1219
  assert_equal "a", spec.name
@@ -1222,13 +1222,13 @@ dependencies: []
1222
1222
 
1223
1223
  def test__dump
1224
1224
  @a2.platform = Gem::Platform.local
1225
- @a2.instance_variable_set :@original_platform, 'old_platform'
1225
+ @a2.instance_variable_set :@original_platform, "old_platform"
1226
1226
 
1227
1227
  data = Marshal.dump @a2
1228
1228
 
1229
1229
  same_spec = Marshal.load data
1230
1230
 
1231
- assert_equal 'old_platform', same_spec.original_platform
1231
+ assert_equal "old_platform", same_spec.original_platform
1232
1232
  end
1233
1233
 
1234
1234
  def test_activate
@@ -1247,7 +1247,7 @@ dependencies: []
1247
1247
  end
1248
1248
 
1249
1249
  def test_add_dependency_from_existing_dependency
1250
- dep = Gem::Dependency.new("existing_dep", Gem::Requirement.new('> 1'), :runtime)
1250
+ dep = Gem::Dependency.new("existing_dep", Gem::Requirement.new("> 1"), :runtime)
1251
1251
  spec = Gem::Specification.new {|s| s.add_dependency dep }
1252
1252
  assert_equal dep, spec.dependencies.first
1253
1253
  end
@@ -1262,22 +1262,22 @@ dependencies: []
1262
1262
  end
1263
1263
 
1264
1264
  def test_author
1265
- assert_equal 'A User', @a1.author
1265
+ assert_equal "A User", @a1.author
1266
1266
  end
1267
1267
 
1268
1268
  def test_authors
1269
- assert_equal ['A User'], @a1.authors
1269
+ assert_equal ["A User"], @a1.authors
1270
1270
  end
1271
1271
 
1272
1272
  def test_bindir_equals
1273
- @a1.bindir = 'apps'
1273
+ @a1.bindir = "apps"
1274
1274
 
1275
- assert_equal 'apps', @a1.bindir
1275
+ assert_equal "apps", @a1.bindir
1276
1276
  end
1277
1277
 
1278
1278
  def test_bindir_equals_nil
1279
1279
  @a2.bindir = nil
1280
- @a2.executable = 'app'
1280
+ @a2.executable = "app"
1281
1281
 
1282
1282
  assert_nil @a2.bindir
1283
1283
  assert_equal %w[app lib/code.rb].sort, @a2.files
@@ -1313,14 +1313,14 @@ dependencies: []
1313
1313
 
1314
1314
  assert_empty @ext.build_args
1315
1315
 
1316
- File.open @ext.build_info_file, 'w' do |io|
1316
+ File.open @ext.build_info_file, "w" do |io|
1317
1317
  io.puts
1318
1318
  end
1319
1319
 
1320
1320
  assert_empty @ext.build_args
1321
1321
 
1322
- File.open @ext.build_info_file, 'w' do |io|
1323
- io.puts '--with-foo-dir=wherever'
1322
+ File.open @ext.build_info_file, "w" do |io|
1323
+ io.puts "--with-foo-dir=wherever"
1324
1324
  end
1325
1325
 
1326
1326
  assert_equal %w[--with-foo-dir=wherever], @ext.build_args
@@ -1330,13 +1330,13 @@ dependencies: []
1330
1330
  pend "extensions don't quite work on jruby" if Gem.java_platform?
1331
1331
  ext_spec
1332
1332
 
1333
- assert_path_not_exist @ext.extension_dir, 'sanity check'
1334
- refute_empty @ext.extensions, 'sanity check'
1333
+ assert_path_not_exist @ext.extension_dir, "sanity check"
1334
+ refute_empty @ext.extensions, "sanity check"
1335
1335
 
1336
1336
  extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
1337
1337
  FileUtils.mkdir_p File.dirname extconf_rb
1338
1338
 
1339
- File.open extconf_rb, 'w' do |f|
1339
+ File.open extconf_rb, "w" do |f|
1340
1340
  f.write <<-'RUBY'
1341
1341
  File.open 'Makefile', 'w' do |f|
1342
1342
  f.puts "clean:\n\techo clean"
@@ -1352,13 +1352,13 @@ dependencies: []
1352
1352
  end
1353
1353
 
1354
1354
  def test_default_spec_stub_is_marked_default
1355
- default = new_default_spec 'default', 2
1355
+ default = new_default_spec "default", 2
1356
1356
  install_default_gems default
1357
1357
 
1358
- stub = Gem::Specification.stubs.find {|s| s.name == 'default' }
1358
+ stub = Gem::Specification.stubs.find {|s| s.name == "default" }
1359
1359
  assert_predicate stub, :default_gem?
1360
1360
 
1361
- stub = Gem::Specification.find_all_by_name('default').first
1361
+ stub = Gem::Specification.find_all_by_name("default").first
1362
1362
  assert_predicate stub, :default_gem?
1363
1363
  end
1364
1364
 
@@ -1366,28 +1366,28 @@ dependencies: []
1366
1366
  pend "extensions don't quite work on jruby" if Gem.java_platform?
1367
1367
  ext_spec
1368
1368
 
1369
- refute_empty @ext.extensions, 'sanity check'
1369
+ refute_empty @ext.extensions, "sanity check"
1370
1370
 
1371
1371
  gem_build_complete =
1372
- File.join @ext.extension_dir, 'gem.build_complete'
1372
+ File.join @ext.extension_dir, "gem.build_complete"
1373
1373
 
1374
1374
  FileUtils.mkdir_p @ext.extension_dir
1375
1375
  FileUtils.touch gem_build_complete
1376
1376
 
1377
1377
  @ext.build_extensions
1378
1378
 
1379
- gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
1379
+ gem_make_out = File.join @ext.extension_dir, "gem_make.out"
1380
1380
  assert_path_not_exist gem_make_out
1381
1381
  end
1382
1382
 
1383
1383
  def test_build_extensions_default_gem
1384
- spec = new_default_spec 'default', 1
1385
- spec.extensions << 'extconf.rb'
1384
+ spec = new_default_spec "default", 1
1385
+ spec.extensions << "extconf.rb"
1386
1386
 
1387
1387
  extconf_rb = File.join spec.gem_dir, spec.extensions.first
1388
1388
  FileUtils.mkdir_p File.dirname extconf_rb
1389
1389
 
1390
- File.open extconf_rb, 'w' do |f|
1390
+ File.open extconf_rb, "w" do |f|
1391
1391
  f.write <<-'RUBY'
1392
1392
  File.open 'Makefile', 'w' do |f|
1393
1393
  f.puts "default:\n\techo built"
@@ -1405,7 +1405,7 @@ dependencies: []
1405
1405
  pend "extensions don't quite work on jruby" if Gem.java_platform?
1406
1406
  ext_spec
1407
1407
 
1408
- refute_empty @ext.extensions, 'sanity check'
1408
+ refute_empty @ext.extensions, "sanity check"
1409
1409
 
1410
1410
  assert_raise Gem::Ext::BuildError do
1411
1411
  @ext.build_extensions
@@ -1413,18 +1413,18 @@ dependencies: []
1413
1413
  end
1414
1414
 
1415
1415
  def test_build_extensions_extensions_dir_unwritable
1416
- pend 'chmod not supported' if Gem.win_platform?
1417
- pend 'skipped in root privilege' if Process.uid.zero?
1416
+ pend "chmod not supported" if Gem.win_platform?
1417
+ pend "skipped in root privilege" if Process.uid.zero?
1418
1418
 
1419
1419
  pend "extensions don't quite work on jruby" if Gem.java_platform?
1420
1420
  ext_spec
1421
1421
 
1422
- refute_empty @ext.extensions, 'sanity check'
1422
+ refute_empty @ext.extensions, "sanity check"
1423
1423
 
1424
1424
  extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
1425
1425
  FileUtils.mkdir_p File.dirname extconf_rb
1426
1426
 
1427
- File.open extconf_rb, 'w' do |f|
1427
+ File.open extconf_rb, "w" do |f|
1428
1428
  f.write <<-'RUBY'
1429
1429
  File.open 'Makefile', 'w' do |f|
1430
1430
  f.puts "clean:\n\techo clean"
@@ -1434,30 +1434,30 @@ dependencies: []
1434
1434
  RUBY
1435
1435
  end
1436
1436
 
1437
- FileUtils.mkdir_p File.join @ext.base_dir, 'extensions'
1437
+ FileUtils.mkdir_p File.join @ext.base_dir, "extensions"
1438
1438
  FileUtils.chmod 0555, @ext.base_dir
1439
- FileUtils.chmod 0555, File.join(@ext.base_dir, 'extensions')
1439
+ FileUtils.chmod 0555, File.join(@ext.base_dir, "extensions")
1440
1440
 
1441
1441
  @ext.build_extensions
1442
1442
  assert_path_not_exist @ext.extension_dir
1443
1443
  ensure
1444
1444
  unless ($DEBUG or win_platform? or Process.uid.zero? or Gem.java_platform?)
1445
- FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions')
1445
+ FileUtils.chmod 0755, File.join(@ext.base_dir, "extensions")
1446
1446
  FileUtils.chmod 0755, @ext.base_dir
1447
1447
  end
1448
1448
  end
1449
1449
 
1450
1450
  def test_build_extensions_no_extensions_dir_unwritable
1451
- pend 'chmod not supported' if Gem.win_platform?
1451
+ pend "chmod not supported" if Gem.win_platform?
1452
1452
  pend "extensions don't quite work on jruby" if Gem.java_platform?
1453
1453
  ext_spec
1454
1454
 
1455
- refute_empty @ext.extensions, 'sanity check'
1455
+ refute_empty @ext.extensions, "sanity check"
1456
1456
 
1457
1457
  extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
1458
1458
  FileUtils.mkdir_p File.dirname extconf_rb
1459
1459
 
1460
- File.open extconf_rb, 'w' do |f|
1460
+ File.open extconf_rb, "w" do |f|
1461
1461
  f.write <<-'RUBY'
1462
1462
  File.open 'Makefile', 'w' do |f|
1463
1463
  f.puts "clean:\n\techo clean"
@@ -1467,20 +1467,20 @@ dependencies: []
1467
1467
  RUBY
1468
1468
  end
1469
1469
 
1470
- FileUtils.rm_r File.join @gemhome, 'extensions'
1470
+ FileUtils.rm_r File.join @gemhome, "extensions"
1471
1471
  FileUtils.chmod 0555, @gemhome
1472
1472
 
1473
1473
  @ext.build_extensions
1474
1474
 
1475
- gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
1475
+ gem_make_out = File.join @ext.extension_dir, "gem_make.out"
1476
1476
  assert_path_not_exist gem_make_out
1477
1477
  ensure
1478
1478
  FileUtils.chmod 0755, @gemhome
1479
1479
  end
1480
1480
 
1481
1481
  def test_build_extensions_none
1482
- assert_path_not_exist @a1.extension_dir, 'sanity check'
1483
- assert_empty @a1.extensions, 'sanity check'
1482
+ assert_path_not_exist @a1.extension_dir, "sanity check"
1483
+ assert_empty @a1.extensions, "sanity check"
1484
1484
 
1485
1485
  @a1.build_extensions
1486
1486
 
@@ -1494,7 +1494,7 @@ dependencies: []
1494
1494
  extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
1495
1495
  FileUtils.mkdir_p File.dirname extconf_rb
1496
1496
 
1497
- File.open extconf_rb, 'w' do |f|
1497
+ File.open extconf_rb, "w" do |f|
1498
1498
  f.write <<-'RUBY'
1499
1499
  File.open 'Makefile', 'w' do |f|
1500
1500
  f.puts "clean:\n\techo clean"
@@ -1504,22 +1504,22 @@ dependencies: []
1504
1504
  RUBY
1505
1505
  end
1506
1506
 
1507
- refute_empty @ext.extensions, 'sanity check'
1507
+ refute_empty @ext.extensions, "sanity check"
1508
1508
 
1509
- @ext.installed_by_version = v('2.2.0.preview.2')
1509
+ @ext.installed_by_version = v("2.2.0.preview.2")
1510
1510
 
1511
1511
  @ext.build_extensions
1512
1512
 
1513
- gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
1513
+ gem_make_out = File.join @ext.extension_dir, "gem_make.out"
1514
1514
  assert_path_exist gem_make_out
1515
1515
  end
1516
1516
 
1517
1517
  def test_contains_requirable_file_eh
1518
- code_rb = File.join @a1.gem_dir, 'lib', 'code.rb'
1518
+ code_rb = File.join @a1.gem_dir, "lib", "code.rb"
1519
1519
  FileUtils.mkdir_p File.dirname code_rb
1520
1520
  FileUtils.touch code_rb
1521
1521
 
1522
- assert @a1.contains_requirable_file? 'code'
1522
+ assert @a1.contains_requirable_file? "code"
1523
1523
  end
1524
1524
 
1525
1525
  def test_contains_requirable_file_eh_extension
@@ -1527,7 +1527,7 @@ dependencies: []
1527
1527
  ext_spec
1528
1528
 
1529
1529
  _, err = capture_output do
1530
- refute @ext.contains_requirable_file? 'nonexistent'
1530
+ refute @ext.contains_requirable_file? "nonexistent"
1531
1531
  end
1532
1532
 
1533
1533
  expected = "Ignoring ext-1 because its extensions are not built. " +
@@ -1540,7 +1540,7 @@ dependencies: []
1540
1540
  ext_spec(platform: Gem::Platform.new("java"))
1541
1541
 
1542
1542
  _, err = capture_output do
1543
- refute @ext.contains_requirable_file? 'nonexistent'
1543
+ refute @ext.contains_requirable_file? "nonexistent"
1544
1544
  end
1545
1545
 
1546
1546
  assert_empty err
@@ -1556,13 +1556,13 @@ dependencies: []
1556
1556
  end
1557
1557
 
1558
1558
  def test_date_equals_string
1559
- @a1.date = '2003-09-17'
1559
+ @a1.date = "2003-09-17"
1560
1560
  assert_equal Time.utc(2003, 9, 17, 0,0,0), @a1.date
1561
1561
  end
1562
1562
 
1563
1563
  def test_date_equals_string_bad
1564
1564
  assert_raise Gem::InvalidSpecificationException do
1565
- @a1.date = '9/11/2003'
1565
+ @a1.date = "9/11/2003"
1566
1566
  end
1567
1567
  end
1568
1568
 
@@ -1609,7 +1609,7 @@ dependencies: []
1609
1609
 
1610
1610
  assert_empty @gem.dependent_gems
1611
1611
 
1612
- bonobo = util_spec 'bonobo', 1
1612
+ bonobo = util_spec "bonobo", 1
1613
1613
  install_gem bonobo
1614
1614
  install_gem @gem
1615
1615
 
@@ -1621,11 +1621,11 @@ dependencies: []
1621
1621
  end
1622
1622
 
1623
1623
  def test_doc_dir
1624
- assert_equal File.join(@gemhome, 'doc', 'a-1'), @a1.doc_dir
1624
+ assert_equal File.join(@gemhome, "doc", "a-1"), @a1.doc_dir
1625
1625
  end
1626
1626
 
1627
1627
  def test_doc_dir_type
1628
- assert_equal File.join(@gemhome, 'doc', 'a-1', 'ri'), @a1.doc_dir('ri')
1628
+ assert_equal File.join(@gemhome, "doc", "a-1", "ri"), @a1.doc_dir("ri")
1629
1629
  end
1630
1630
 
1631
1631
  def test_runtime_dependencies
@@ -1639,12 +1639,12 @@ dependencies: []
1639
1639
  end
1640
1640
 
1641
1641
  def test_description
1642
- assert_equal 'This is a test description', @a1.description
1642
+ assert_equal "This is a test description", @a1.description
1643
1643
  end
1644
1644
 
1645
1645
  def test_eql_eh
1646
- g1 = util_spec 'gem', 1
1647
- g2 = util_spec 'gem', 1
1646
+ g1 = util_spec "gem", 1
1647
+ g2 = util_spec "gem", 1
1648
1648
 
1649
1649
  assert_equal g1, g2
1650
1650
  assert_equal g1.hash, g2.hash
@@ -1653,47 +1653,47 @@ dependencies: []
1653
1653
 
1654
1654
  def test_eql_eh_extensions
1655
1655
  spec = @a1.dup
1656
- spec.extensions = 'xx'
1656
+ spec.extensions = "xx"
1657
1657
 
1658
1658
  refute_operator @a1, :eql?, spec
1659
1659
  refute_operator spec, :eql?, @a1
1660
1660
  end
1661
1661
 
1662
1662
  def test_executables
1663
- @a1.executable = 'app'
1663
+ @a1.executable = "app"
1664
1664
  assert_equal %w[app], @a1.executables
1665
1665
  end
1666
1666
 
1667
1667
  def test_executable_equals
1668
- @a2.executable = 'app'
1669
- assert_equal 'app', @a2.executable
1668
+ @a2.executable = "app"
1669
+ assert_equal "app", @a2.executable
1670
1670
  assert_equal %w[bin/app lib/code.rb].sort, @a2.files
1671
1671
  end
1672
1672
 
1673
1673
  def test_extensions
1674
- assert_equal ['ext/extconf.rb'], ext_spec.extensions
1674
+ assert_equal ["ext/extconf.rb"], ext_spec.extensions
1675
1675
  end
1676
1676
 
1677
1677
  def test_extension_dir
1678
- enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] =
1679
- RbConfig::CONFIG['ENABLE_SHARED'], 'no'
1678
+ enable_shared, RbConfig::CONFIG["ENABLE_SHARED"] =
1679
+ RbConfig::CONFIG["ENABLE_SHARED"], "no"
1680
1680
 
1681
1681
  ext_spec
1682
1682
 
1683
1683
  refute_empty @ext.extensions
1684
1684
 
1685
1685
  expected =
1686
- File.join(@ext.base_dir, 'extensions', Gem::Platform.local.to_s,
1686
+ File.join(@ext.base_dir, "extensions", Gem::Platform.local.to_s,
1687
1687
  "#{Gem.ruby_api_version}-static", @ext.full_name)
1688
1688
 
1689
1689
  assert_equal expected, @ext.extension_dir
1690
1690
  ensure
1691
- RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared
1691
+ RbConfig::CONFIG["ENABLE_SHARED"] = enable_shared
1692
1692
  end
1693
1693
 
1694
1694
  def test_extension_dir_override
1695
- enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] =
1696
- RbConfig::CONFIG['ENABLE_SHARED'], 'no'
1695
+ enable_shared, RbConfig::CONFIG["ENABLE_SHARED"] =
1696
+ RbConfig::CONFIG["ENABLE_SHARED"], "no"
1697
1697
 
1698
1698
  class << Gem
1699
1699
  alias orig_default_ext_dir_for default_ext_dir_for
@@ -1701,7 +1701,7 @@ dependencies: []
1701
1701
  remove_method :default_ext_dir_for
1702
1702
 
1703
1703
  def Gem.default_ext_dir_for(base_dir)
1704
- 'elsewhere'
1704
+ "elsewhere"
1705
1705
  end
1706
1706
  end
1707
1707
 
@@ -1709,11 +1709,11 @@ dependencies: []
1709
1709
 
1710
1710
  refute_empty @ext.extensions
1711
1711
 
1712
- expected = File.join @tempdir, 'elsewhere', @ext.full_name
1712
+ expected = File.join @tempdir, "elsewhere", @ext.full_name
1713
1713
 
1714
1714
  assert_equal expected, @ext.extension_dir
1715
1715
  ensure
1716
- RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared
1716
+ RbConfig::CONFIG["ENABLE_SHARED"] = enable_shared
1717
1717
 
1718
1718
  class << Gem
1719
1719
  remove_method :default_ext_dir_for
@@ -1803,9 +1803,9 @@ dependencies: []
1803
1803
  end
1804
1804
 
1805
1805
  def test_for_cache
1806
- @a2.add_runtime_dependency 'b', '1'
1806
+ @a2.add_runtime_dependency "b", "1"
1807
1807
  @a2.dependencies.first.instance_variable_set :@type, nil
1808
- @a2.required_rubygems_version = Gem::Requirement.new '> 0'
1808
+ @a2.required_rubygems_version = Gem::Requirement.new "> 0"
1809
1809
  @a2.test_files = %w[test/test_b.rb]
1810
1810
 
1811
1811
  refute_empty @a2.files
@@ -1821,11 +1821,11 @@ dependencies: []
1821
1821
  end
1822
1822
 
1823
1823
  def test_full_gem_path
1824
- assert_equal File.join(@gemhome, 'gems', @a1.full_name), @a1.full_gem_path
1824
+ assert_equal File.join(@gemhome, "gems", @a1.full_name), @a1.full_gem_path
1825
1825
 
1826
- @a1.original_platform = 'mswin32'
1826
+ @a1.original_platform = "mswin32"
1827
1827
 
1828
- assert_equal File.join(@gemhome, 'gems', @a1.original_name),
1828
+ assert_equal File.join(@gemhome, "gems", @a1.original_name),
1829
1829
  @a1.full_gem_path
1830
1830
  end
1831
1831
 
@@ -1838,40 +1838,40 @@ dependencies: []
1838
1838
  end
1839
1839
 
1840
1840
  def test_full_name
1841
- assert_equal 'a-1', @a1.full_name
1841
+ assert_equal "a-1", @a1.full_name
1842
1842
 
1843
1843
  @a1 = Gem::Specification.new "a", 1
1844
- @a1.platform = Gem::Platform.new ['universal', 'darwin', nil]
1845
- assert_equal 'a-1-universal-darwin', @a1.full_name
1844
+ @a1.platform = Gem::Platform.new ["universal", "darwin", nil]
1845
+ assert_equal "a-1-universal-darwin", @a1.full_name
1846
1846
 
1847
1847
  @a1 = Gem::Specification.new "a", 1
1848
- @a1.instance_variable_set :@new_platform, 'mswin32'
1849
- assert_equal 'a-1-mswin32', @a1.full_name, 'legacy'
1848
+ @a1.instance_variable_set :@new_platform, "mswin32"
1849
+ assert_equal "a-1-mswin32", @a1.full_name, "legacy"
1850
1850
 
1851
1851
  return if win_platform?
1852
1852
 
1853
1853
  @a1 = Gem::Specification.new "a", 1
1854
- @a1.platform = 'current'
1855
- assert_equal 'a-1-x86-darwin-8', @a1.full_name
1854
+ @a1.platform = "current"
1855
+ assert_equal "a-1-x86-darwin-8", @a1.full_name
1856
1856
  end
1857
1857
 
1858
1858
  def test_full_name_windows
1859
1859
  test_cases = {
1860
- 'i386-mswin32' => 'a-1-x86-mswin32-60',
1861
- 'i386-mswin32_80' => 'a-1-x86-mswin32-80',
1862
- 'i386-mingw32' => 'a-1-x86-mingw32',
1860
+ "i386-mswin32" => "a-1-x86-mswin32-60",
1861
+ "i386-mswin32_80" => "a-1-x86-mswin32-80",
1862
+ "i386-mingw32" => "a-1-x86-mingw32",
1863
1863
  }
1864
1864
 
1865
1865
  test_cases.each do |arch, expected|
1866
1866
  @a1 = Gem::Specification.new "a", 1
1867
1867
  util_set_arch arch
1868
- @a1.platform = 'current'
1868
+ @a1.platform = "current"
1869
1869
  assert_equal expected, @a1.full_name
1870
1870
  end
1871
1871
  end
1872
1872
 
1873
1873
  def test_gem_build_complete_path
1874
- expected = File.join @a1.extension_dir, 'gem.build_complete'
1874
+ expected = File.join @a1.extension_dir, "gem.build_complete"
1875
1875
  assert_equal expected, @a1.gem_build_complete_path
1876
1876
  end
1877
1877
 
@@ -1915,23 +1915,23 @@ dependencies: []
1915
1915
  end
1916
1916
 
1917
1917
  def test_license
1918
- assert_equal 'MIT', @a1.license
1918
+ assert_equal "MIT", @a1.license
1919
1919
  end
1920
1920
 
1921
1921
  def test_licenses
1922
- assert_equal ['MIT'], @a1.licenses
1922
+ assert_equal ["MIT"], @a1.licenses
1923
1923
  end
1924
1924
 
1925
1925
  def test_name
1926
- assert_equal 'a', @a1.name
1926
+ assert_equal "a", @a1.name
1927
1927
  end
1928
1928
 
1929
1929
  def test_original_name
1930
- assert_equal 'a-1', @a1.full_name
1930
+ assert_equal "a-1", @a1.full_name
1931
1931
 
1932
- @a1.platform = 'i386-linux'
1933
- @a1.instance_variable_set :@original_platform, 'i386-linux'
1934
- assert_equal 'a-1-i386-linux', @a1.original_name
1932
+ @a1.platform = "i386-linux"
1933
+ @a1.instance_variable_set :@original_platform, "i386-linux"
1934
+ assert_equal "a-1-i386-linux", @a1.original_name
1935
1935
  end
1936
1936
 
1937
1937
  def test_platform
@@ -1960,10 +1960,10 @@ dependencies: []
1960
1960
  assert_equal Gem::Platform::RUBY, @a1.platform
1961
1961
 
1962
1962
  test_cases = {
1963
- 'i386-mswin32' => ['x86', 'mswin32', '60'],
1964
- 'i386-mswin32_80' => ['x86', 'mswin32', '80'],
1965
- 'i386-mingw32' => ['x86', 'mingw32', nil ],
1966
- 'x86-darwin8' => ['x86', 'darwin', '8' ],
1963
+ "i386-mswin32" => ["x86", "mswin32", "60"],
1964
+ "i386-mswin32_80" => ["x86", "mswin32", "80"],
1965
+ "i386-mingw32" => ["x86", "mingw32", nil ],
1966
+ "x86-darwin8" => ["x86", "darwin", "8" ],
1967
1967
  }
1968
1968
 
1969
1969
  test_cases.each do |arch, expected|
@@ -1980,29 +1980,29 @@ dependencies: []
1980
1980
  end
1981
1981
 
1982
1982
  def test_platform_equals_legacy
1983
- @a1.platform = 'mswin32'
1984
- assert_equal Gem::Platform.new('x86-mswin32'), @a1.platform
1983
+ @a1.platform = "mswin32"
1984
+ assert_equal Gem::Platform.new("x86-mswin32"), @a1.platform
1985
1985
 
1986
- @a1.platform = 'i586-linux'
1987
- assert_equal Gem::Platform.new('x86-linux'), @a1.platform
1986
+ @a1.platform = "i586-linux"
1987
+ assert_equal Gem::Platform.new("x86-linux"), @a1.platform
1988
1988
 
1989
- @a1.platform = 'powerpc-darwin'
1990
- assert_equal Gem::Platform.new('ppc-darwin'), @a1.platform
1989
+ @a1.platform = "powerpc-darwin"
1990
+ assert_equal Gem::Platform.new("ppc-darwin"), @a1.platform
1991
1991
  end
1992
1992
 
1993
1993
  def test_prerelease_spec_adds_required_rubygems_version
1994
- @prerelease = util_spec('tardis', '2.2.0.a')
1995
- refute @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.3.1'))
1996
- assert @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new('1.4.0'))
1994
+ @prerelease = util_spec("tardis", "2.2.0.a")
1995
+ refute @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new("1.3.1"))
1996
+ assert @prerelease.required_rubygems_version.satisfied_by?(Gem::Version.new("1.4.0"))
1997
1997
  end
1998
1998
 
1999
1999
  def test_require_paths
2000
- enable_shared 'no' do
2000
+ enable_shared "no" do
2001
2001
  ext_spec
2002
2002
 
2003
- @ext.require_paths = 'lib'
2003
+ @ext.require_paths = "lib"
2004
2004
 
2005
- assert_equal [@ext.extension_dir, 'lib'], @ext.require_paths
2005
+ assert_equal [@ext.extension_dir, "lib"], @ext.require_paths
2006
2006
  end
2007
2007
  end
2008
2008
 
@@ -2014,15 +2014,15 @@ dependencies: []
2014
2014
  end
2015
2015
 
2016
2016
  def Gem.default_ext_dir_for(base_dir)
2017
- '/foo'
2017
+ "/foo"
2018
2018
  end
2019
2019
 
2020
- enable_shared 'no' do
2020
+ enable_shared "no" do
2021
2021
  ext_spec
2022
2022
 
2023
- @ext.require_paths = 'lib'
2023
+ @ext.require_paths = "lib"
2024
2024
 
2025
- assert_equal [File.expand_path('/foo/ext-1'), 'lib'], @ext.require_paths
2025
+ assert_equal [File.expand_path("/foo/ext-1"), "lib"], @ext.require_paths
2026
2026
  end
2027
2027
  ensure
2028
2028
  class << Gem
@@ -2040,7 +2040,7 @@ dependencies: []
2040
2040
  ext_spec
2041
2041
 
2042
2042
  @ext.require_paths = %w[lib ext foo]
2043
- @ext.extensions << 'bar/baz'
2043
+ @ext.extensions << "bar/baz"
2044
2044
 
2045
2045
  expected = %w[
2046
2046
  lib
@@ -2055,10 +2055,10 @@ dependencies: []
2055
2055
  def test_full_require_paths
2056
2056
  ext_spec
2057
2057
 
2058
- @ext.require_paths = 'lib'
2058
+ @ext.require_paths = "lib"
2059
2059
 
2060
2060
  expected = [
2061
- File.join(@gemhome, 'gems', @ext.original_name, 'lib'),
2061
+ File.join(@gemhome, "gems", @ext.original_name, "lib"),
2062
2062
  @ext.extension_dir,
2063
2063
  ]
2064
2064
 
@@ -2068,10 +2068,10 @@ dependencies: []
2068
2068
  def test_to_fullpath
2069
2069
  ext_spec
2070
2070
 
2071
- @ext.require_paths = 'lib'
2071
+ @ext.require_paths = "lib"
2072
2072
 
2073
- dir = File.join(@gemhome, 'gems', @ext.original_name, 'lib')
2074
- expected_rb = File.join(dir, 'code.rb')
2073
+ dir = File.join(@gemhome, "gems", @ext.original_name, "lib")
2074
+ expected_rb = File.join(dir, "code.rb")
2075
2075
  FileUtils.mkdir_p dir
2076
2076
  FileUtils.touch expected_rb
2077
2077
 
@@ -2105,10 +2105,10 @@ dependencies: []
2105
2105
  def test_fullpath_return_rb_extension_file_when_exist_the_same_name_file
2106
2106
  ext_spec
2107
2107
 
2108
- @ext.require_paths = 'lib'
2108
+ @ext.require_paths = "lib"
2109
2109
 
2110
- dir = File.join(@gemhome, 'gems', @ext.original_name, 'lib')
2111
- expected_rb = File.join(dir, 'code.rb')
2110
+ dir = File.join(@gemhome, "gems", @ext.original_name, "lib")
2111
+ expected_rb = File.join(dir, "code.rb")
2112
2112
  FileUtils.mkdir_p dir
2113
2113
  FileUtils.touch expected_rb
2114
2114
 
@@ -2160,12 +2160,12 @@ dependencies: []
2160
2160
  end
2161
2161
 
2162
2162
  def test_requirements
2163
- assert_equal ['A working computer'], @a1.requirements
2163
+ assert_equal ["A working computer"], @a1.requirements
2164
2164
  end
2165
2165
 
2166
2166
  def test_allowed_push_host
2167
- assert_nil @a1.metadata['allowed_push_host']
2168
- assert_equal 'https://privategemserver.com', @a3.metadata['allowed_push_host']
2167
+ assert_nil @a1.metadata["allowed_push_host"]
2168
+ assert_equal "https://privategemserver.com", @a3.metadata["allowed_push_host"]
2169
2169
  end
2170
2170
 
2171
2171
  def test_runtime_dependencies_legacy
@@ -2181,8 +2181,8 @@ dependencies: []
2181
2181
  end
2182
2182
 
2183
2183
  def test_spaceship_name
2184
- s1 = util_spec 'a', '1'
2185
- s2 = util_spec 'b', '1'
2184
+ s1 = util_spec "a", "1"
2185
+ s2 = util_spec "b", "1"
2186
2186
 
2187
2187
  assert_equal(-1, (s1 <=> s2))
2188
2188
  assert_equal(0, (s1 <=> s1))
@@ -2190,9 +2190,9 @@ dependencies: []
2190
2190
  end
2191
2191
 
2192
2192
  def test_spaceship_platform
2193
- s1 = util_spec 'a', '1'
2194
- s2 = util_spec 'a', '1' do |s|
2195
- s.platform = Gem::Platform.new 'x86-my_platform1'
2193
+ s1 = util_spec "a", "1"
2194
+ s2 = util_spec "a", "1" do |s|
2195
+ s.platform = Gem::Platform.new "x86-my_platform1"
2196
2196
  end
2197
2197
 
2198
2198
  assert_equal(-1, (s1 <=> s2))
@@ -2201,8 +2201,8 @@ dependencies: []
2201
2201
  end
2202
2202
 
2203
2203
  def test_spaceship_version
2204
- s1 = util_spec 'a', '1'
2205
- s2 = util_spec 'a', '2'
2204
+ s1 = util_spec "a", "1"
2205
+ s2 = util_spec "a", "2"
2206
2206
 
2207
2207
  assert_equal(-1, (s1 <=> s2))
2208
2208
  assert_equal(0, (s1 <=> s1))
@@ -2210,25 +2210,25 @@ dependencies: []
2210
2210
  end
2211
2211
 
2212
2212
  def test_spec_file
2213
- assert_equal File.join(@gemhome, 'specifications', 'a-1.gemspec'),
2213
+ assert_equal File.join(@gemhome, "specifications", "a-1.gemspec"),
2214
2214
  @a1.spec_file
2215
2215
  end
2216
2216
 
2217
2217
  def test_spec_name
2218
- assert_equal 'a-1.gemspec', @a1.spec_name
2218
+ assert_equal "a-1.gemspec", @a1.spec_name
2219
2219
  end
2220
2220
 
2221
2221
  def test_summary
2222
- assert_equal 'this is a summary', @a1.summary
2222
+ assert_equal "this is a summary", @a1.summary
2223
2223
  end
2224
2224
 
2225
2225
  def test_test_files
2226
- @a1.test_file = 'test/suite.rb'
2227
- assert_equal ['test/suite.rb'], @a1.test_files
2226
+ @a1.test_file = "test/suite.rb"
2227
+ assert_equal ["test/suite.rb"], @a1.test_files
2228
2228
  end
2229
2229
 
2230
2230
  def test_runtime_predicate_true
2231
- @a2.add_runtime_dependency 'b', '1'
2231
+ @a2.add_runtime_dependency "b", "1"
2232
2232
  assert_predicate @a2.dependencies.first, :runtime?
2233
2233
 
2234
2234
  @a2.dependencies.first.instance_variable_set :@type, nil
@@ -2236,15 +2236,15 @@ dependencies: []
2236
2236
  end
2237
2237
 
2238
2238
  def test_runtime_predicate_false
2239
- @a2.add_development_dependency 'b', '1'
2239
+ @a2.add_development_dependency "b", "1"
2240
2240
  refute_predicate @a2.dependencies.first, :runtime?
2241
2241
  end
2242
2242
 
2243
2243
  def test_to_ruby
2244
- @a2.add_runtime_dependency 'b', '1'
2244
+ @a2.add_runtime_dependency "b", "1"
2245
2245
  @a2.dependencies.first.instance_variable_set :@type, nil
2246
- @a2.required_rubygems_version = Gem::Requirement.new '> 0'
2247
- @a2.require_paths << 'other'
2246
+ @a2.required_rubygems_version = Gem::Requirement.new "> 0"
2247
+ @a2.require_paths << "other"
2248
2248
 
2249
2249
  ruby_code = @a2.to_ruby
2250
2250
 
@@ -2287,8 +2287,8 @@ end
2287
2287
  end
2288
2288
 
2289
2289
  def test_to_ruby_with_rsa_key
2290
- require 'rubygems/openssl'
2291
- pend 'openssl is missing' unless defined?(OpenSSL::PKey::RSA)
2290
+ require "rubygems/openssl"
2291
+ pend "openssl is missing" unless defined?(OpenSSL::PKey::RSA)
2292
2292
 
2293
2293
  rsa_key = OpenSSL::PKey::RSA.new(2048)
2294
2294
  @a2.signing_key = rsa_key
@@ -2319,9 +2319,9 @@ end
2319
2319
  end
2320
2320
 
2321
2321
  def test_to_ruby_for_cache
2322
- @a2.add_runtime_dependency 'b', '1'
2322
+ @a2.add_runtime_dependency "b", "1"
2323
2323
  @a2.dependencies.first.instance_variable_set :@type, nil
2324
- @a2.required_rubygems_version = Gem::Requirement.new '> 0'
2324
+ @a2.required_rubygems_version = Gem::Requirement.new "> 0"
2325
2325
  @a2.installed_by_version = Gem.rubygems_version
2326
2326
 
2327
2327
  # cached specs do not have spec.files populated:
@@ -2430,8 +2430,8 @@ end
2430
2430
  end
2431
2431
 
2432
2432
  def test_to_ruby_keeps_requirements_as_originally_specified
2433
- spec = util_spec 'a', '1' do |s|
2434
- s.add_dependency 'b', ['~> 1.0', '>= 1.0.0']
2433
+ spec = util_spec "a", "1" do |s|
2434
+ s.add_dependency "b", ["~> 1.0", ">= 1.0.0"]
2435
2435
  end
2436
2436
 
2437
2437
  assert_includes spec.to_ruby, '"~> 1.0", ">= 1.0.0"'
@@ -2460,13 +2460,13 @@ end
2460
2460
 
2461
2461
  def test_to_ruby_platform
2462
2462
  @a2.platform = Gem::Platform.local
2463
- @a2.instance_variable_set :@original_platform, 'old_platform'
2463
+ @a2.instance_variable_set :@original_platform, "old_platform"
2464
2464
 
2465
2465
  ruby_code = @a2.to_ruby
2466
2466
 
2467
2467
  same_spec = eval ruby_code
2468
2468
 
2469
- assert_equal 'old_platform', same_spec.original_platform
2469
+ assert_equal "old_platform", same_spec.original_platform
2470
2470
  end
2471
2471
 
2472
2472
  def test_to_yaml
@@ -2491,21 +2491,21 @@ end
2491
2491
  end
2492
2492
 
2493
2493
  def test_to_yaml_platform_empty_string
2494
- @a1.instance_variable_set :@original_platform, ''
2494
+ @a1.instance_variable_set :@original_platform, ""
2495
2495
 
2496
2496
  assert_match %r{^platform: ruby$}, @a1.to_yaml
2497
2497
  end
2498
2498
 
2499
2499
  def test_to_yaml_platform_legacy
2500
- @a1.platform = 'powerpc-darwin7.9.0'
2501
- @a1.instance_variable_set :@original_platform, 'powerpc-darwin7.9.0'
2500
+ @a1.platform = "powerpc-darwin7.9.0"
2501
+ @a1.instance_variable_set :@original_platform, "powerpc-darwin7.9.0"
2502
2502
 
2503
2503
  yaml_str = @a1.to_yaml
2504
2504
 
2505
2505
  same_spec = load_yaml yaml_str
2506
2506
 
2507
- assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
2508
- assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
2507
+ assert_equal Gem::Platform.new("powerpc-darwin7"), same_spec.platform
2508
+ assert_equal "powerpc-darwin7.9.0", same_spec.original_platform
2509
2509
  end
2510
2510
 
2511
2511
  def test_to_yaml_platform_nil
@@ -2522,7 +2522,7 @@ end
2522
2522
  end
2523
2523
  end
2524
2524
 
2525
- def x(s); s.gsub(/xxx/, ''); end
2525
+ def x(s); s.gsub(/xxx/, ""); end
2526
2526
  def w; x "WARxxxNING"; end
2527
2527
  def t; x "TOxxxDO"; end
2528
2528
  def f; x "FxxxIXME"; end
@@ -2537,7 +2537,7 @@ end
2537
2537
  @a1.validate
2538
2538
  end
2539
2539
 
2540
- assert_match "#{w}: no author specified\n", @ui.error, 'error'
2540
+ assert_match "#{w}: no author specified\n", @ui.error, "error"
2541
2541
 
2542
2542
  @a1.authors = [Object.new]
2543
2543
 
@@ -2571,14 +2571,14 @@ end
2571
2571
  util_setup_validate
2572
2572
 
2573
2573
  Dir.chdir @tempdir do
2574
- @a1.autorequire = 'code'
2574
+ @a1.autorequire = "code"
2575
2575
 
2576
2576
  use_ui @ui do
2577
2577
  @a1.validate
2578
2578
  end
2579
2579
 
2580
2580
  assert_match "#{w}: deprecated autorequire specified\n",
2581
- @ui.error, 'error'
2581
+ @ui.error, "error"
2582
2582
  end
2583
2583
  end
2584
2584
 
@@ -2586,19 +2586,19 @@ end
2586
2586
  util_setup_validate
2587
2587
 
2588
2588
  Dir.chdir @tempdir do
2589
- @a1.add_runtime_dependency 'b', '>= 1.0.rc1'
2590
- @a1.add_development_dependency 'c', '>= 2.0.rc2'
2591
- @a1.add_runtime_dependency 'd', '~> 1.2.3'
2592
- @a1.add_runtime_dependency 'e', '~> 1.2.3.4'
2593
- @a1.add_runtime_dependency 'g', '~> 1.2.3', '>= 1.2.3.4'
2594
- @a1.add_runtime_dependency 'h', '>= 1.2.3', '<= 2'
2595
- @a1.add_runtime_dependency 'i', '>= 1.2'
2596
- @a1.add_runtime_dependency 'j', '>= 1.2.3'
2597
- @a1.add_runtime_dependency 'k', '> 1.2'
2598
- @a1.add_runtime_dependency 'l', '> 1.2.3'
2599
- @a1.add_runtime_dependency 'm', '~> 2.1.0'
2600
- @a1.add_runtime_dependency 'n', '~> 0.1.0'
2601
- @a1.add_runtime_dependency 'o'
2589
+ @a1.add_runtime_dependency "b", ">= 1.0.rc1"
2590
+ @a1.add_development_dependency "c", ">= 2.0.rc2"
2591
+ @a1.add_runtime_dependency "d", "~> 1.2.3"
2592
+ @a1.add_runtime_dependency "e", "~> 1.2.3.4"
2593
+ @a1.add_runtime_dependency "g", "~> 1.2.3", ">= 1.2.3.4"
2594
+ @a1.add_runtime_dependency "h", ">= 1.2.3", "<= 2"
2595
+ @a1.add_runtime_dependency "i", ">= 1.2"
2596
+ @a1.add_runtime_dependency "j", ">= 1.2.3"
2597
+ @a1.add_runtime_dependency "k", "> 1.2"
2598
+ @a1.add_runtime_dependency "l", "> 1.2.3"
2599
+ @a1.add_runtime_dependency "m", "~> 2.1.0"
2600
+ @a1.add_runtime_dependency "n", "~> 0.1.0"
2601
+ @a1.add_runtime_dependency "o"
2602
2602
 
2603
2603
  use_ui @ui do
2604
2604
  @a1.validate
@@ -2624,7 +2624,7 @@ end
2624
2624
  #{w}: See https://guides.rubygems.org/specification-reference/ for help
2625
2625
  EXPECTED
2626
2626
 
2627
- assert_equal expected, @ui.error, 'warning'
2627
+ assert_equal expected, @ui.error, "warning"
2628
2628
  end
2629
2629
  end
2630
2630
 
@@ -2632,10 +2632,10 @@ end
2632
2632
  util_setup_validate
2633
2633
 
2634
2634
  Dir.chdir @tempdir do
2635
- @a1.add_runtime_dependency 'b', '~> 1.2'
2636
- @a1.add_runtime_dependency 'b', '>= 1.2.3'
2637
- @a1.add_development_dependency 'c', '~> 1.2'
2638
- @a1.add_development_dependency 'c', '>= 1.2.3'
2635
+ @a1.add_runtime_dependency "b", "~> 1.2"
2636
+ @a1.add_runtime_dependency "b", ">= 1.2.3"
2637
+ @a1.add_development_dependency "c", "~> 1.2"
2638
+ @a1.add_development_dependency "c", ">= 1.2.3"
2639
2639
 
2640
2640
  use_ui @ui do
2641
2641
  e = assert_raise Gem::InvalidSpecificationException do
@@ -2662,14 +2662,14 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2662
2662
  util_setup_validate
2663
2663
 
2664
2664
  Dir.chdir @tempdir do
2665
- @a1.add_runtime_dependency 'b', '~> 1.2'
2666
- @a1.add_development_dependency 'b', '= 1.2.3'
2665
+ @a1.add_runtime_dependency "b", "~> 1.2"
2666
+ @a1.add_development_dependency "b", "= 1.2.3"
2667
2667
 
2668
2668
  use_ui @ui do
2669
2669
  @a1.validate
2670
2670
  end
2671
2671
 
2672
- assert_equal '', @ui.error, 'warning'
2672
+ assert_equal "", @ui.error, "warning"
2673
2673
  end
2674
2674
  end
2675
2675
 
@@ -2677,14 +2677,14 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2677
2677
  util_setup_validate
2678
2678
 
2679
2679
  Dir.chdir @tempdir do
2680
- @a1.version = '1.0.0.beta.1'
2681
- @a1.add_runtime_dependency 'b', '~> 1.2.0.beta.1'
2680
+ @a1.version = "1.0.0.beta.1"
2681
+ @a1.add_runtime_dependency "b", "~> 1.2.0.beta.1"
2682
2682
 
2683
2683
  use_ui @ui do
2684
2684
  @a1.validate
2685
2685
  end
2686
2686
 
2687
- assert_equal '', @ui.error, 'warning'
2687
+ assert_equal "", @ui.error, "warning"
2688
2688
  end
2689
2689
  end
2690
2690
 
@@ -2692,8 +2692,8 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2692
2692
  util_setup_validate
2693
2693
 
2694
2694
  Dir.chdir @tempdir do
2695
- @a1.extensions = ['Rakefile']
2696
- File.write File.join(@tempdir, 'Rakefile'), ''
2695
+ @a1.extensions = ["Rakefile"]
2696
+ File.write File.join(@tempdir, "Rakefile"), ""
2697
2697
 
2698
2698
  use_ui @ui do
2699
2699
  @a1.validate
@@ -2707,9 +2707,9 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2707
2707
  util_setup_validate
2708
2708
 
2709
2709
  Dir.chdir @tempdir do
2710
- @a1.extensions = ['Rakefile']
2711
- @a1.add_runtime_dependency 'rake'
2712
- File.write File.join(@tempdir, 'Rakefile'), ''
2710
+ @a1.extensions = ["Rakefile"]
2711
+ @a1.add_runtime_dependency "rake"
2712
+ File.write File.join(@tempdir, "Rakefile"), ""
2713
2713
 
2714
2714
  use_ui @ui do
2715
2715
  @a1.validate
@@ -2723,7 +2723,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2723
2723
  util_setup_validate
2724
2724
 
2725
2725
  Dir.chdir @tempdir do
2726
- @a1.description = ''
2726
+ @a1.description = ""
2727
2727
 
2728
2728
  use_ui @ui do
2729
2729
  @a1.validate
@@ -2813,7 +2813,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2813
2813
  Gem::Specification.new.validate
2814
2814
  end
2815
2815
 
2816
- assert_equal 'missing value for attribute name', e.message
2816
+ assert_equal "missing value for attribute name", e.message
2817
2817
  end
2818
2818
 
2819
2819
  def test_validate_error
@@ -2823,15 +2823,15 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2823
2823
  end
2824
2824
  end
2825
2825
 
2826
- assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
2826
+ assert_match "See https://guides.rubygems.org/specification-reference/ for help", @ui.error
2827
2827
  end
2828
2828
 
2829
2829
  def test_validate_executables
2830
2830
  util_setup_validate
2831
2831
 
2832
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
2833
- File.write File.join(@tempdir, 'bin', 'exec'), ''
2834
- FileUtils.mkdir_p File.join(@tempdir, 'exec')
2832
+ FileUtils.mkdir_p File.join(@tempdir, "bin")
2833
+ File.write File.join(@tempdir, "bin", "exec"), ""
2834
+ FileUtils.mkdir_p File.join(@tempdir, "exec")
2835
2835
 
2836
2836
  use_ui @ui do
2837
2837
  Dir.chdir @tempdir do
@@ -2841,13 +2841,13 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2841
2841
 
2842
2842
  assert_equal %w[exec], @a1.executables
2843
2843
 
2844
- assert_equal '', @ui.output, 'output'
2845
- assert_match "#{w}: bin/exec is missing #! line\n", @ui.error, 'error'
2844
+ assert_equal "", @ui.output, "output"
2845
+ assert_match "#{w}: bin/exec is missing #! line\n", @ui.error, "error"
2846
2846
  end
2847
2847
 
2848
2848
  def test_validate_empty_require_paths
2849
2849
  if win_platform?
2850
- pend 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
2850
+ pend "test_validate_empty_require_paths skipped on MS Windows (symlink)"
2851
2851
  else
2852
2852
  util_setup_validate
2853
2853
 
@@ -2856,26 +2856,26 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2856
2856
  @a1.validate
2857
2857
  end
2858
2858
 
2859
- assert_equal 'specification must have at least one require_path',
2859
+ assert_equal "specification must have at least one require_path",
2860
2860
  e.message
2861
2861
  end
2862
2862
  end
2863
2863
 
2864
2864
  def test_validate_files
2865
- pend 'test_validate_files skipped on MS Windows (symlink)' if win_platform?
2865
+ pend "test_validate_files skipped on MS Windows (symlink)" if win_platform?
2866
2866
  util_setup_validate
2867
2867
 
2868
- @a1.files += ['lib', 'lib2']
2869
- @a1.extensions << 'ext/a/extconf.rb'
2868
+ @a1.files += ["lib", "lib2"]
2869
+ @a1.extensions << "ext/a/extconf.rb"
2870
2870
 
2871
2871
  Dir.chdir @tempdir do
2872
- FileUtils.ln_s 'lib/code.rb', 'lib2' unless vc_windows?
2872
+ FileUtils.ln_s "lib/code.rb", "lib2" unless vc_windows?
2873
2873
 
2874
2874
  use_ui @ui do
2875
2875
  @a1.validate
2876
2876
  end
2877
2877
 
2878
- assert_match 'WARNING: lib2 is a symlink, which is not supported on all platforms', @ui.error
2878
+ assert_match "WARNING: lib2 is a symlink, which is not supported on all platforms", @ui.error
2879
2879
  end
2880
2880
 
2881
2881
  assert_equal %w[bin/exec ext/a/extconf.rb lib/code.rb lib2 test/suite.rb].sort,
@@ -2981,19 +2981,19 @@ Please report a bug if this causes problems.
2981
2981
  @a1.validate
2982
2982
  end
2983
2983
 
2984
- assert_match "#{w}: no homepage specified\n", @ui.error, 'error'
2984
+ assert_match "#{w}: no homepage specified\n", @ui.error, "error"
2985
2985
 
2986
2986
  @ui = Gem::MockGemUi.new
2987
2987
 
2988
- @a1.homepage = ''
2988
+ @a1.homepage = ""
2989
2989
 
2990
2990
  use_ui @ui do
2991
2991
  @a1.validate
2992
2992
  end
2993
2993
 
2994
- assert_match "#{w}: no homepage specified\n", @ui.error, 'error'
2994
+ assert_match "#{w}: no homepage specified\n", @ui.error, "error"
2995
2995
 
2996
- @a1.homepage = 'over at my cool site'
2996
+ @a1.homepage = "over at my cool site"
2997
2997
 
2998
2998
  e = assert_raise Gem::InvalidSpecificationException do
2999
2999
  @a1.validate
@@ -3001,7 +3001,7 @@ Please report a bug if this causes problems.
3001
3001
 
3002
3002
  assert_equal '"over at my cool site" is not a valid HTTP URI', e.message
3003
3003
 
3004
- @a1.homepage = 'ftp://rubygems.org'
3004
+ @a1.homepage = "ftp://rubygems.org"
3005
3005
 
3006
3006
  e = assert_raise Gem::InvalidSpecificationException do
3007
3007
  @a1.validate
@@ -3009,12 +3009,11 @@ Please report a bug if this causes problems.
3009
3009
 
3010
3010
  assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message
3011
3011
 
3012
- @a1.homepage = 'https://rubygems.org/'
3012
+ @a1.homepage = "https://rubygems.org/"
3013
3013
  assert_equal true, @a1.validate
3014
3014
 
3015
- @a1.homepage = 'https://rubygems.org'
3015
+ @a1.homepage = "https://rubygems.org"
3016
3016
  assert_equal true, @a1.validate
3017
-
3018
3017
  end
3019
3018
  end
3020
3019
 
@@ -3051,7 +3050,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3051
3050
  util_setup_validate
3052
3051
 
3053
3052
  use_ui @ui do
3054
- @a1.rubyforge_project = 'invalid-attribute'
3053
+ @a1.rubyforge_project = "invalid-attribute"
3055
3054
  @a1.validate
3056
3055
  end
3057
3056
 
@@ -3062,7 +3061,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3062
3061
  util_setup_validate
3063
3062
 
3064
3063
  use_ui @ui do
3065
- @a1.licenses = ['BSD']
3064
+ @a1.licenses = ["BSD"]
3066
3065
  @a1.validate
3067
3066
  end
3068
3067
 
@@ -3076,7 +3075,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3076
3075
  util_setup_validate
3077
3076
 
3078
3077
  use_ui @ui do
3079
- @a1.licenses = ['LicenseRef-LICENSE.md']
3078
+ @a1.licenses = ["LicenseRef-LICENSE.md"]
3080
3079
  @a1.validate
3081
3080
  end
3082
3081
 
@@ -3087,7 +3086,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3087
3086
  util_setup_validate
3088
3087
 
3089
3088
  use_ui @ui do
3090
- @a1.licenses = ['GPL-2.0+']
3089
+ @a1.licenses = ["GPL-2.0+"]
3091
3090
  @a1.validate
3092
3091
  end
3093
3092
 
@@ -3098,7 +3097,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3098
3097
  util_setup_validate
3099
3098
 
3100
3099
  use_ui @ui do
3101
- @a1.licenses = ['GPL-2.0-or-later']
3100
+ @a1.licenses = ["GPL-2.0-or-later"]
3102
3101
  @a1.validate
3103
3102
  end
3104
3103
 
@@ -3109,7 +3108,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3109
3108
  util_setup_validate
3110
3109
 
3111
3110
  use_ui @ui do
3112
- @a1.licenses = ['GPL-2.0+ WITH Autoconf-exception-2.0']
3111
+ @a1.licenses = ["GPL-2.0+ WITH Autoconf-exception-2.0"]
3113
3112
  @a1.validate
3114
3113
  end
3115
3114
 
@@ -3120,7 +3119,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3120
3119
  util_setup_validate
3121
3120
 
3122
3121
  use_ui @ui do
3123
- @a1.licenses = ['GPL-2.0+ FOO', 'GPL-2.0 FOO']
3122
+ @a1.licenses = ["GPL-2.0+ FOO", "GPL-2.0 FOO"]
3124
3123
  @a1.validate
3125
3124
  end
3126
3125
 
@@ -3138,7 +3137,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3138
3137
  util_setup_validate
3139
3138
 
3140
3139
  use_ui @ui do
3141
- @a1.licenses = ['GPL-2.0+ WITH Autocofn-exception-2.0']
3140
+ @a1.licenses = ["GPL-2.0+ WITH Autocofn-exception-2.0"]
3142
3141
  @a1.validate
3143
3142
  end
3144
3143
 
@@ -3152,7 +3151,7 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
3152
3151
  util_setup_validate
3153
3152
 
3154
3153
  use_ui @ui do
3155
- @a1.licenses = ['ruby']
3154
+ @a1.licenses = ["ruby"]
3156
3155
  @a1.validate
3157
3156
  end
3158
3157
 
@@ -3262,13 +3261,13 @@ Did you mean 'Ruby'?
3262
3261
  end
3263
3262
 
3264
3263
  def test_validate_permissions
3265
- pend 'chmod not supported' if Gem.win_platform?
3264
+ pend "chmod not supported" if Gem.win_platform?
3266
3265
 
3267
3266
  util_setup_validate
3268
3267
 
3269
3268
  Dir.chdir @tempdir do
3270
- File.chmod 0640, File.join('lib', 'code.rb')
3271
- File.chmod 0640, File.join('bin', 'exec')
3269
+ File.chmod 0640, File.join("lib", "code.rb")
3270
+ File.chmod 0640, File.join("bin", "exec")
3272
3271
 
3273
3272
  use_ui @ui do
3274
3273
  @a1.validate
@@ -3281,12 +3280,12 @@ Did you mean 'Ruby'?
3281
3280
  end
3282
3281
 
3283
3282
  def test_validate_permissions_of_missing_file_non_packaging
3284
- pend 'chmod not supported' if Gem.win_platform?
3283
+ pend "chmod not supported" if Gem.win_platform?
3285
3284
 
3286
3285
  util_setup_validate
3287
3286
 
3288
3287
  Dir.chdir @tempdir do
3289
- File.delete File.join('lib', 'code.rb')
3288
+ File.delete File.join("lib", "code.rb")
3290
3289
 
3291
3290
  use_ui @ui do
3292
3291
  assert @a1.validate(false)
@@ -3298,13 +3297,13 @@ Did you mean 'Ruby'?
3298
3297
  util_setup_validate
3299
3298
 
3300
3299
  Dir.chdir @tempdir do
3301
- @a1.platform = 'mswin32'
3300
+ @a1.platform = "mswin32"
3302
3301
  assert @a1.validate
3303
3302
 
3304
- @a1.platform = 'i586-linux'
3303
+ @a1.platform = "i586-linux"
3305
3304
  assert @a1.validate
3306
3305
 
3307
- @a1.platform = 'powerpc-darwin'
3306
+ @a1.platform = "powerpc-darwin"
3308
3307
  assert @a1.validate
3309
3308
  end
3310
3309
  end
@@ -3325,7 +3324,7 @@ Did you mean 'Ruby'?
3325
3324
  util_setup_validate
3326
3325
 
3327
3326
  Dir.chdir @tempdir do
3328
- @a1.specification_version = '1.0'
3327
+ @a1.specification_version = "1.0"
3329
3328
 
3330
3329
  e = assert_raise Gem::InvalidSpecificationException do
3331
3330
  use_ui @ui do
@@ -3333,7 +3332,7 @@ Did you mean 'Ruby'?
3333
3332
  end
3334
3333
  end
3335
3334
 
3336
- err = 'specification_version must be an Integer (did you mean version?)'
3335
+ err = "specification_version must be an Integer (did you mean version?)"
3337
3336
  assert_equal err, e.message
3338
3337
  end
3339
3338
  end
@@ -3342,13 +3341,13 @@ Did you mean 'Ruby'?
3342
3341
  util_setup_validate
3343
3342
 
3344
3343
  Dir.chdir @tempdir do
3345
- @a1.summary = ''
3344
+ @a1.summary = ""
3346
3345
 
3347
3346
  use_ui @ui do
3348
3347
  @a1.validate
3349
3348
  end
3350
3349
 
3351
- assert_match "#{w}: no summary specified\n", @ui.error, 'error'
3350
+ assert_match "#{w}: no summary specified\n", @ui.error, "error"
3352
3351
 
3353
3352
  @a1.summary = "#{f} (describe your package)"
3354
3353
 
@@ -3376,11 +3375,11 @@ Did you mean 'Ruby'?
3376
3375
  @a1.validate
3377
3376
  end
3378
3377
 
3379
- assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
3378
+ assert_match "See https://guides.rubygems.org/specification-reference/ for help", @ui.error
3380
3379
  end
3381
3380
 
3382
3381
  def test_version
3383
- assert_equal Gem::Version.new('1'), @a1.version
3382
+ assert_equal Gem::Version.new("1"), @a1.version
3384
3383
  end
3385
3384
 
3386
3385
  def test_version_change_reset_full_name
@@ -3426,22 +3425,22 @@ Did you mean 'Ruby'?
3426
3425
 
3427
3426
  def test_latest_specs
3428
3427
  spec_fetcher do |fetcher|
3429
- fetcher.spec 'a', 1 do |s|
3430
- s.platform = Gem::Platform.new 'x86-my_platform1'
3428
+ fetcher.spec "a", 1 do |s|
3429
+ s.platform = Gem::Platform.new "x86-my_platform1"
3431
3430
  end
3432
3431
 
3433
- fetcher.spec 'a', 2
3432
+ fetcher.spec "a", 2
3434
3433
 
3435
- fetcher.spec 'a', 2 do |s|
3436
- s.platform = Gem::Platform.new 'x86-my_platform1'
3434
+ fetcher.spec "a", 2 do |s|
3435
+ s.platform = Gem::Platform.new "x86-my_platform1"
3437
3436
  end
3438
3437
 
3439
- fetcher.spec 'a', 2 do |s|
3440
- s.platform = Gem::Platform.new 'x86-other_platform1'
3438
+ fetcher.spec "a", 2 do |s|
3439
+ s.platform = Gem::Platform.new "x86-other_platform1"
3441
3440
  end
3442
3441
 
3443
- fetcher.spec 'a', 3 do |s|
3444
- s.platform = Gem::Platform.new 'x86-other_platform1'
3442
+ fetcher.spec "a", 3 do |s|
3443
+ s.platform = Gem::Platform.new "x86-other_platform1"
3445
3444
  end
3446
3445
  end
3447
3446
 
@@ -3458,7 +3457,7 @@ Did you mean 'Ruby'?
3458
3457
  util_setup_validate
3459
3458
 
3460
3459
  Dir.chdir @tempdir do
3461
- @m1 = quick_gem 'm', '1' do |s|
3460
+ @m1 = quick_gem "m", "1" do |s|
3462
3461
  s.files = %w[lib/code.rb]
3463
3462
  s.metadata = {
3464
3463
  "one" => "two",
@@ -3478,7 +3477,7 @@ Did you mean 'Ruby'?
3478
3477
  util_setup_validate
3479
3478
 
3480
3479
  Dir.chdir @tempdir do
3481
- @m2 = quick_gem 'm', '2' do |s|
3480
+ @m2 = quick_gem "m", "2" do |s|
3482
3481
  s.files = %w[lib/code.rb]
3483
3482
  s.metadata = { 1 => "fail" }
3484
3483
  end
@@ -3495,7 +3494,7 @@ Did you mean 'Ruby'?
3495
3494
  util_setup_validate
3496
3495
 
3497
3496
  Dir.chdir @tempdir do
3498
- @m2 = quick_gem 'm', '2' do |s|
3497
+ @m2 = quick_gem "m", "2" do |s|
3499
3498
  s.files = %w[lib/code.rb]
3500
3499
  s.metadata = { ("x" * 129) => "fail" }
3501
3500
  end
@@ -3512,9 +3511,9 @@ Did you mean 'Ruby'?
3512
3511
  util_setup_validate
3513
3512
 
3514
3513
  Dir.chdir @tempdir do
3515
- @m2 = quick_gem 'm', '2' do |s|
3514
+ @m2 = quick_gem "m", "2" do |s|
3516
3515
  s.files = %w[lib/code.rb]
3517
- s.metadata = { 'fail' => [] }
3516
+ s.metadata = { "fail" => [] }
3518
3517
  end
3519
3518
 
3520
3519
  e = assert_raise Gem::InvalidSpecificationException do
@@ -3529,9 +3528,9 @@ Did you mean 'Ruby'?
3529
3528
  util_setup_validate
3530
3529
 
3531
3530
  Dir.chdir @tempdir do
3532
- @m2 = quick_gem 'm', '2' do |s|
3531
+ @m2 = quick_gem "m", "2" do |s|
3533
3532
  s.files = %w[lib/code.rb]
3534
- s.metadata = { 'fail' => ("x" * 1025) }
3533
+ s.metadata = { "fail" => ("x" * 1025) }
3535
3534
  end
3536
3535
 
3537
3536
  e = assert_raise Gem::InvalidSpecificationException do
@@ -3546,9 +3545,9 @@ Did you mean 'Ruby'?
3546
3545
  util_setup_validate
3547
3546
 
3548
3547
  Dir.chdir @tempdir do
3549
- @m2 = quick_gem 'm', '2' do |s|
3548
+ @m2 = quick_gem "m", "2" do |s|
3550
3549
  s.files = %w[lib/code.rb]
3551
- s.metadata = { 'homepage_uri' => 'http:/example.com' }
3550
+ s.metadata = { "homepage_uri" => "http:/example.com" }
3552
3551
  end
3553
3552
 
3554
3553
  e = assert_raise Gem::InvalidSpecificationException do
@@ -3560,9 +3559,9 @@ Did you mean 'Ruby'?
3560
3559
  end
3561
3560
 
3562
3561
  def test_metadata_specs
3563
- @m1 = quick_gem 'm', '1' do |s|
3562
+ @m1 = quick_gem "m", "1" do |s|
3564
3563
  s.files = %w[lib/code.rb]
3565
- s.metadata = { 'one' => "two", 'two' => "three" }
3564
+ s.metadata = { "one" => "two", "two" => "three" }
3566
3565
  end
3567
3566
 
3568
3567
  valid_ruby_spec = <<-EOF
@@ -3599,7 +3598,7 @@ end
3599
3598
  extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
3600
3599
  FileUtils.mkdir_p File.dirname extconf_rb
3601
3600
 
3602
- File.open extconf_rb, 'w' do |f|
3601
+ File.open extconf_rb, "w" do |f|
3603
3602
  f.write <<-'RUBY'
3604
3603
  File.open 'Makefile', 'w' do |f|
3605
3604
  f.puts "clean:\n\techo clean"
@@ -3615,8 +3614,8 @@ end
3615
3614
  end
3616
3615
 
3617
3616
  def test_missing_extensions_eh_default_gem
3618
- spec = new_default_spec 'default', 1
3619
- spec.extensions << 'extconf.rb'
3617
+ spec = new_default_spec "default", 1
3618
+ spec.extensions << "extconf.rb"
3620
3619
 
3621
3620
  refute spec.missing_extensions?
3622
3621
  end
@@ -3626,7 +3625,7 @@ end
3626
3625
  end
3627
3626
 
3628
3627
  def test_find_all_by_full_name
3629
- pl = Gem::Platform.new 'i386-linux'
3628
+ pl = Gem::Platform.new "i386-linux"
3630
3629
 
3631
3630
  a1 = util_spec "a", "1"
3632
3631
  a1_pre = util_spec "a", "1.0.0.pre.1"
@@ -3693,9 +3692,9 @@ end
3693
3692
 
3694
3693
  install_specs a
3695
3694
 
3696
- assert_equal a, Gem::Specification.find_by_path('foo')
3695
+ assert_equal a, Gem::Specification.find_by_path("foo")
3697
3696
  a.activate
3698
- assert_equal a, Gem::Specification.find_by_path('foo')
3697
+ assert_equal a, Gem::Specification.find_by_path("foo")
3699
3698
  end
3700
3699
 
3701
3700
  def test_find_inactive_by_path
@@ -3703,9 +3702,9 @@ end
3703
3702
 
3704
3703
  install_specs a
3705
3704
 
3706
- assert_equal a, Gem::Specification.find_inactive_by_path('foo')
3705
+ assert_equal a, Gem::Specification.find_inactive_by_path("foo")
3707
3706
  a.activate
3708
- assert_nil Gem::Specification.find_inactive_by_path('foo')
3707
+ assert_nil Gem::Specification.find_inactive_by_path("foo")
3709
3708
  end
3710
3709
 
3711
3710
  def test_load_default_gem