opal 0.3.42 → 0.3.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (553) hide show
  1. data/CHANGELOG.md +29 -0
  2. data/CONTRIBUTING.md +9 -1
  3. data/Rakefile +58 -21
  4. data/config.ru +14 -0
  5. data/examples/rack/Gemfile +3 -0
  6. data/examples/rack/README.md +22 -0
  7. data/examples/rack/app/app.rb +5 -0
  8. data/examples/rack/config.ru +20 -0
  9. data/examples/rack/index.html +12 -0
  10. data/examples/server/Gemfile +3 -0
  11. data/examples/server/README.md +22 -0
  12. data/examples/server/app/app.rb +18 -0
  13. data/examples/server/config.ru +10 -0
  14. data/examples/server/index.html.erb +10 -0
  15. data/lib/opal.rb +4 -1
  16. data/lib/opal/erb.rb +41 -0
  17. data/lib/opal/lexer.rb +1 -1
  18. data/lib/opal/parser.rb +5 -12
  19. data/lib/opal/processor.rb +70 -0
  20. data/lib/opal/server.rb +93 -0
  21. data/lib/opal/version.rb +1 -1
  22. data/opal.gemspec +1 -1
  23. data/opal/{opal/date.rb → date.rb} +0 -0
  24. data/opal/erb.rb +19 -0
  25. data/{spec → opal}/fileutils.rb +0 -0
  26. data/{spec → opal}/iconv.rb +0 -0
  27. data/opal/observer.rb +202 -0
  28. data/opal/opal-browser/local_storage.rb +27 -0
  29. data/opal/opal-browser/script_loader.rb +40 -0
  30. data/opal/opal-eventable.rb +26 -0
  31. data/opal/opal-parser.js.erb +8 -3
  32. data/opal/{opal/template.rb → opal-template.rb} +0 -0
  33. data/opal/opal.rb +20 -18
  34. data/opal/opal/array.rb +1 -1
  35. data/opal/opal/class.rb +6 -1
  36. data/opal/opal/kernel.rb +1 -1
  37. data/opal/opal/native.rb +91 -5
  38. data/opal/opal/runtime.js +39 -8
  39. data/{spec → opal}/pp.rb +0 -0
  40. data/opal/{opal/racc.rb → racc.rb} +0 -0
  41. data/{spec → opal}/rbconfig.rb +0 -0
  42. data/opal/{opal/strscan.rb → strscan.rb} +0 -0
  43. data/{spec → opal}/yaml.rb +0 -0
  44. data/spec/{core_ext → opal}/array/element_reference_spec.rb +0 -0
  45. data/spec/{core_ext → opal}/array/equal_value_spec.rb +0 -0
  46. data/spec/{core_ext → opal}/array/fill_spec.rb +0 -0
  47. data/spec/{core_ext → opal}/array/reduce_spec.rb +0 -0
  48. data/spec/{core_ext → opal}/array/to_json_spec.rb +0 -0
  49. data/spec/{core_ext → opal}/basic_object/send_spec.rb +0 -0
  50. data/spec/{core_ext → opal}/boolean/singleton_class_spec.rb +0 -0
  51. data/spec/{core_ext → opal}/boolean/to_json_spec.rb +0 -0
  52. data/spec/opal/browser/local_storage_spec.rb +55 -0
  53. data/spec/{core_ext → opal}/class/_inherited_spec.rb +0 -0
  54. data/spec/{core_ext → opal}/class/proc_methods_spec.rb +0 -0
  55. data/spec/{core_ext → opal}/class/singleton_methods_spec.rb +0 -0
  56. data/spec/{core_ext → opal}/constants_spec.rb +0 -0
  57. data/spec/opal/erb/erb_spec.rb +31 -0
  58. data/spec/opal/eventable_spec.rb +75 -0
  59. data/spec/{core_ext → opal}/method_missing_spec.rb +0 -0
  60. data/spec/opal/native/element_reference_spec.rb +40 -0
  61. data/spec/opal/native/equal_spec.rb +17 -0
  62. data/spec/opal/native/fixtures/classes.rb +27 -0
  63. data/spec/opal/native/global_spec.rb +12 -0
  64. data/spec/opal/native/initialize_spec.rb +8 -0
  65. data/spec/opal/native/method_missing_spec.rb +53 -0
  66. data/spec/{core_ext → opal}/native/to_native_spec.rb +1 -1
  67. data/spec/{core_ext → opal}/nil/to_json_spec.rb +0 -0
  68. data/spec/opal/runtime/eval_spec.rb +5 -0
  69. data/spec/opal/runtime/send_spec.rb +34 -0
  70. data/spec/ospec/main.rb.erb +9 -3
  71. data/spec/ospec/runner.rb +132 -5
  72. data/spec/{grammar → parser}/alias_spec.rb +0 -0
  73. data/spec/{grammar → parser}/and_spec.rb +0 -0
  74. data/spec/{grammar → parser}/array_spec.rb +0 -0
  75. data/spec/{grammar → parser}/attrasgn_spec.rb +0 -0
  76. data/spec/{grammar → parser}/begin_spec.rb +0 -0
  77. data/spec/{grammar → parser}/block_spec.rb +0 -0
  78. data/spec/{grammar → parser}/break_spec.rb +0 -0
  79. data/spec/{grammar → parser}/call_spec.rb +0 -0
  80. data/spec/{grammar → parser}/class_spec.rb +0 -0
  81. data/spec/{grammar → parser}/const_spec.rb +0 -0
  82. data/spec/{grammar → parser}/cvar_spec.rb +0 -0
  83. data/spec/{grammar → parser}/def_spec.rb +0 -0
  84. data/spec/{grammar → parser}/false_spec.rb +0 -0
  85. data/spec/{grammar → parser}/file_spec.rb +0 -0
  86. data/spec/{grammar → parser}/gvar_spec.rb +0 -0
  87. data/spec/{grammar → parser}/hash_spec.rb +0 -0
  88. data/spec/{grammar → parser}/iasgn_spec.rb +0 -0
  89. data/spec/{grammar → parser}/if_spec.rb +0 -0
  90. data/spec/{grammar → parser}/iter_spec.rb +0 -0
  91. data/spec/{grammar → parser}/ivar_spec.rb +0 -0
  92. data/spec/{grammar → parser}/lambda_spec.rb +0 -0
  93. data/spec/{grammar → parser}/lasgn_spec.rb +0 -0
  94. data/spec/{grammar → parser}/line_spec.rb +0 -0
  95. data/spec/{grammar → parser}/lvar_spec.rb +0 -0
  96. data/spec/{grammar → parser}/masgn_spec.rb +0 -0
  97. data/spec/{grammar → parser}/module_spec.rb +0 -0
  98. data/spec/{grammar → parser}/nil_spec.rb +0 -0
  99. data/spec/{grammar → parser}/not_spec.rb +0 -0
  100. data/spec/{grammar → parser}/nth_ref_spec.rb +0 -0
  101. data/spec/{grammar → parser}/op_asgn1_spec.rb +0 -0
  102. data/spec/{grammar → parser}/op_asgn2_spec.rb +0 -0
  103. data/spec/{grammar → parser}/or_spec.rb +0 -0
  104. data/spec/{grammar → parser}/parser_spec.rb +0 -0
  105. data/spec/{grammar → parser}/return_spec.rb +0 -0
  106. data/spec/{grammar → parser}/sclass_spec.rb +0 -0
  107. data/spec/{grammar → parser}/self_spec.rb +0 -0
  108. data/spec/{grammar → parser}/str_spec.rb +0 -0
  109. data/spec/{grammar → parser}/string_spec.rb +0 -0
  110. data/spec/{grammar → parser}/strscan/check_spec.rb +0 -0
  111. data/spec/{grammar → parser}/strscan/scan_spec.rb +0 -0
  112. data/spec/{grammar → parser}/super_spec.rb +0 -0
  113. data/spec/{grammar → parser}/true_spec.rb +0 -0
  114. data/spec/{grammar → parser}/undef_spec.rb +0 -0
  115. data/spec/{grammar → parser}/unless_spec.rb +0 -0
  116. data/spec/{grammar → parser}/while_spec.rb +0 -0
  117. data/spec/{grammar → parser}/xstr_spec.rb +0 -0
  118. data/spec/{grammar → parser}/yield_spec.rb +0 -0
  119. data/spec/{core → rubyspec/core}/array/allocate_spec.rb +0 -0
  120. data/spec/{core → rubyspec/core}/array/append_spec.rb +0 -0
  121. data/spec/{core → rubyspec/core}/array/array_spec.rb +0 -0
  122. data/spec/{core → rubyspec/core}/array/assoc_spec.rb +0 -0
  123. data/spec/{core → rubyspec/core}/array/at_spec.rb +0 -0
  124. data/spec/{core → rubyspec/core}/array/choice_spec.rb +0 -0
  125. data/spec/{core → rubyspec/core}/array/clear_spec.rb +0 -0
  126. data/spec/{core → rubyspec/core}/array/clone_spec.rb +0 -0
  127. data/spec/{core → rubyspec/core}/array/collect_spec.rb +0 -0
  128. data/spec/{core → rubyspec/core}/array/combination_spec.rb +0 -0
  129. data/spec/{core → rubyspec/core}/array/compact_spec.rb +0 -0
  130. data/spec/{core → rubyspec/core}/array/comparison_spec.rb +0 -0
  131. data/spec/{core → rubyspec/core}/array/concat_spec.rb +0 -0
  132. data/spec/{core → rubyspec/core}/array/constructor_spec.rb +0 -0
  133. data/spec/{core → rubyspec/core}/array/count_spec.rb +0 -0
  134. data/spec/{core → rubyspec/core}/array/delete_at_spec.rb +0 -0
  135. data/spec/{core → rubyspec/core}/array/delete_if_spec.rb +0 -0
  136. data/spec/{core → rubyspec/core}/array/delete_spec.rb +0 -0
  137. data/spec/{core → rubyspec/core}/array/drop_spec.rb +0 -0
  138. data/spec/{core → rubyspec/core}/array/drop_while_spec.rb +0 -0
  139. data/spec/{core → rubyspec/core}/array/dup_spec.rb +0 -0
  140. data/spec/{core → rubyspec/core}/array/each_index_spec.rb +0 -0
  141. data/spec/{core → rubyspec/core}/array/each_spec.rb +0 -0
  142. data/spec/{core → rubyspec/core}/array/empty_spec.rb +0 -0
  143. data/spec/{core → rubyspec/core}/array/eql_spec.rb +0 -0
  144. data/spec/{core → rubyspec/core}/array/fetch_spec.rb +0 -0
  145. data/spec/{core → rubyspec/core}/array/find_index_spec.rb +0 -0
  146. data/spec/{core → rubyspec/core}/array/first_spec.rb +0 -0
  147. data/spec/{core → rubyspec/core}/array/fixtures/classes.rb +0 -0
  148. data/spec/{core → rubyspec/core}/array/flatten_spec.rb +0 -0
  149. data/spec/{core → rubyspec/core}/array/frozen_spec.rb +0 -0
  150. data/spec/{core → rubyspec/core}/array/include_spec.rb +0 -0
  151. data/spec/{core → rubyspec/core}/array/index_spec.rb +0 -0
  152. data/spec/{core → rubyspec/core}/array/insert_spec.rb +0 -0
  153. data/spec/{core → rubyspec/core}/array/inspect_spec.rb +0 -0
  154. data/spec/{core → rubyspec/core}/array/intersection_spec.rb +0 -0
  155. data/spec/{core → rubyspec/core}/array/join_spec.rb +0 -0
  156. data/spec/{core → rubyspec/core}/array/keep_if_spec.rb +0 -0
  157. data/spec/{core → rubyspec/core}/array/last_spec.rb +0 -0
  158. data/spec/{core → rubyspec/core}/array/length_spec.rb +0 -0
  159. data/spec/{core → rubyspec/core}/array/map_spec.rb +0 -0
  160. data/spec/{core → rubyspec/core}/array/minus_spec.rb +0 -0
  161. data/spec/{core → rubyspec/core}/array/multiply_spec.rb +0 -0
  162. data/spec/{core → rubyspec/core}/array/new_spec.rb +0 -0
  163. data/spec/{core → rubyspec/core}/array/ntimes_spec.rb +0 -0
  164. data/spec/{core → rubyspec/core}/array/plus_spec.rb +0 -0
  165. data/spec/{core → rubyspec/core}/array/pop_spec.rb +0 -0
  166. data/spec/{core → rubyspec/core}/array/push_spec.rb +0 -0
  167. data/spec/{core → rubyspec/core}/array/rassoc_spec.rb +0 -0
  168. data/spec/{core → rubyspec/core}/array/reject_spec.rb +0 -0
  169. data/spec/{core → rubyspec/core}/array/replace_spec.rb +0 -0
  170. data/spec/{core → rubyspec/core}/array/reverse_each_spec.rb +0 -0
  171. data/spec/{core → rubyspec/core}/array/reverse_spec.rb +0 -0
  172. data/spec/{core → rubyspec/core}/array/rindex_spec.rb +0 -0
  173. data/spec/{core → rubyspec/core}/array/select_spec.rb +0 -0
  174. data/spec/{core → rubyspec/core}/array/shared/collect.rb +0 -0
  175. data/spec/{core → rubyspec/core}/array/shared/enumeratorize.rb +0 -0
  176. data/spec/{core → rubyspec/core}/array/shared/eql.rb +0 -0
  177. data/spec/{core → rubyspec/core}/array/shared/index.rb +0 -0
  178. data/spec/{core → rubyspec/core}/array/shared/inspect.rb +0 -0
  179. data/spec/{core → rubyspec/core}/array/shared/join.rb +0 -0
  180. data/spec/{core → rubyspec/core}/array/shared/keep_if.rb +0 -0
  181. data/spec/{core → rubyspec/core}/array/shared/length.rb +0 -0
  182. data/spec/{core → rubyspec/core}/array/shared/replace.rb +0 -0
  183. data/spec/{core → rubyspec/core}/array/shared/slice.rb +0 -0
  184. data/spec/{core → rubyspec/core}/array/shift_spec.rb +0 -0
  185. data/spec/{core → rubyspec/core}/array/shuffle_spec.rb +0 -0
  186. data/spec/{core → rubyspec/core}/array/size_spec.rb +0 -0
  187. data/spec/{core → rubyspec/core}/array/slice_spec.rb +0 -0
  188. data/spec/{core → rubyspec/core}/array/sort_spec.rb +0 -0
  189. data/spec/{core → rubyspec/core}/array/take_spec.rb +0 -0
  190. data/spec/{core → rubyspec/core}/array/take_while_spec.rb +0 -0
  191. data/spec/{core → rubyspec/core}/array/to_a_spec.rb +0 -0
  192. data/spec/{core → rubyspec/core}/array/to_ary_spec.rb +0 -0
  193. data/spec/{core → rubyspec/core}/array/try_convert_spec.rb +0 -0
  194. data/spec/{core → rubyspec/core}/array/uniq_spec.rb +0 -0
  195. data/spec/{core → rubyspec/core}/array/unshift_spec.rb +0 -0
  196. data/spec/{core → rubyspec/core}/array/zip_spec.rb +0 -0
  197. data/spec/{core → rubyspec/core}/class/bridge_class_spec.rb +0 -0
  198. data/spec/{core → rubyspec/core}/class/extend_spec.rb +0 -0
  199. data/spec/{core → rubyspec/core}/class/fixtures/classes.rb +0 -0
  200. data/spec/{core → rubyspec/core}/class/instance_methods_spec.rb +0 -0
  201. data/spec/{core → rubyspec/core}/class/last_value_spec.rb +0 -0
  202. data/spec/{core → rubyspec/core}/class/new_spec.rb +0 -0
  203. data/spec/{core → rubyspec/core}/enumerable/all_spec.rb +0 -0
  204. data/spec/{core → rubyspec/core}/enumerable/any_spec.rb +0 -0
  205. data/spec/{core → rubyspec/core}/enumerable/collect_spec.rb +0 -0
  206. data/spec/{core → rubyspec/core}/enumerable/count_spec.rb +0 -0
  207. data/spec/{core → rubyspec/core}/enumerable/detect_spec.rb +0 -0
  208. data/spec/{core → rubyspec/core}/enumerable/drop_spec.rb +0 -0
  209. data/spec/{core → rubyspec/core}/enumerable/drop_while_spec.rb +0 -0
  210. data/spec/{core → rubyspec/core}/enumerable/each_slice_spec.rb +0 -0
  211. data/spec/{core → rubyspec/core}/enumerable/each_with_index_spec.rb +0 -0
  212. data/spec/{core → rubyspec/core}/enumerable/each_with_object_spec.rb +0 -0
  213. data/spec/{core → rubyspec/core}/enumerable/entries_spec.rb +0 -0
  214. data/spec/{core → rubyspec/core}/enumerable/find_all_spec.rb +0 -0
  215. data/spec/{core → rubyspec/core}/enumerable/find_index_spec.rb +0 -0
  216. data/spec/{core → rubyspec/core}/enumerable/find_spec.rb +0 -0
  217. data/spec/{core → rubyspec/core}/enumerable/first_spec.rb +0 -0
  218. data/spec/{core → rubyspec/core}/enumerable/fixtures/classes.rb +0 -0
  219. data/spec/{core → rubyspec/core}/enumerable/grep_spec.rb +0 -0
  220. data/spec/{core → rubyspec/core}/enumerable/group_by_spec.rb +0 -0
  221. data/spec/{core → rubyspec/core}/enumerable/select_spec.rb +0 -0
  222. data/spec/{core → rubyspec/core}/enumerable/take_spec.rb +0 -0
  223. data/spec/{core → rubyspec/core}/enumerable/to_a_spec.rb +0 -0
  224. data/spec/{core → rubyspec/core}/enumerator/each_spec.rb +0 -0
  225. data/spec/{core → rubyspec/core}/enumerator/new_spec.rb +0 -0
  226. data/spec/{core → rubyspec/core}/enumerator/next_spec.rb +0 -0
  227. data/spec/{core → rubyspec/core}/enumerator/rewind_spec.rb +0 -0
  228. data/spec/{core → rubyspec/core}/false/and_spec.rb +0 -0
  229. data/spec/{core → rubyspec/core}/false/inspect_spec.rb +0 -0
  230. data/spec/{core → rubyspec/core}/false/or_spec.rb +0 -0
  231. data/spec/{core → rubyspec/core}/false/to_s_spec.rb +0 -0
  232. data/spec/{core → rubyspec/core}/false/xor_spec.rb +0 -0
  233. data/spec/{core → rubyspec/core}/hash/allocate_spec.rb +0 -0
  234. data/spec/{core → rubyspec/core}/hash/assoc_spec.rb +0 -0
  235. data/spec/{core → rubyspec/core}/hash/clear_spec.rb +0 -0
  236. data/spec/{core → rubyspec/core}/hash/clone_spec.rb +0 -0
  237. data/spec/{core → rubyspec/core}/hash/constructor_spec.rb +0 -0
  238. data/spec/{core → rubyspec/core}/hash/default_proc_spec.rb +0 -0
  239. data/spec/{core → rubyspec/core}/hash/default_spec.rb +0 -0
  240. data/spec/{core → rubyspec/core}/hash/delete_if_spec.rb +0 -0
  241. data/spec/{core → rubyspec/core}/hash/delete_spec.rb +0 -0
  242. data/spec/{core → rubyspec/core}/hash/dup_spec.rb +0 -0
  243. data/spec/{core → rubyspec/core}/hash/each_key_spec.rb +0 -0
  244. data/spec/{core → rubyspec/core}/hash/each_pair_spec.rb +0 -0
  245. data/spec/{core → rubyspec/core}/hash/each_spec.rb +0 -0
  246. data/spec/{core → rubyspec/core}/hash/each_value_spec.rb +0 -0
  247. data/spec/{core → rubyspec/core}/hash/element_reference_spec.rb +0 -0
  248. data/spec/{core → rubyspec/core}/hash/element_set_spec.rb +0 -0
  249. data/spec/{core → rubyspec/core}/hash/empty_spec.rb +0 -0
  250. data/spec/{core → rubyspec/core}/hash/fetch_spec.rb +0 -0
  251. data/spec/{core → rubyspec/core}/hash/flatten_spec.rb +0 -0
  252. data/spec/{core → rubyspec/core}/hash/has_key_spec.rb +0 -0
  253. data/spec/{core → rubyspec/core}/hash/has_value_spec.rb +0 -0
  254. data/spec/{core → rubyspec/core}/hash/include_spec.rb +0 -0
  255. data/spec/{core → rubyspec/core}/hash/index_spec.rb +0 -0
  256. data/spec/{core → rubyspec/core}/hash/indexes_spec.rb +0 -0
  257. data/spec/{core → rubyspec/core}/hash/indices_spec.rb +0 -0
  258. data/spec/{core → rubyspec/core}/hash/invert_spec.rb +0 -0
  259. data/spec/{core → rubyspec/core}/hash/keep_if_spec.rb +0 -0
  260. data/spec/{core → rubyspec/core}/hash/key_spec.rb +0 -0
  261. data/spec/{core → rubyspec/core}/hash/keys_spec.rb +0 -0
  262. data/spec/{core → rubyspec/core}/hash/length_spec.rb +0 -0
  263. data/spec/{core → rubyspec/core}/hash/member_spec.rb +0 -0
  264. data/spec/{core → rubyspec/core}/hash/merge_spec.rb +0 -0
  265. data/spec/{core → rubyspec/core}/hash/new_spec.rb +0 -0
  266. data/spec/{core → rubyspec/core}/hash/rassoc_spec.rb +0 -0
  267. data/spec/{core → rubyspec/core}/hash/reject_spec.rb +0 -0
  268. data/spec/{core → rubyspec/core}/hash/replace_spec.rb +0 -0
  269. data/spec/{core → rubyspec/core}/hash/select_spec.rb +0 -0
  270. data/spec/{core → rubyspec/core}/hash/shift_spec.rb +0 -0
  271. data/spec/{core → rubyspec/core}/hash/size_spec.rb +0 -0
  272. data/spec/{core → rubyspec/core}/hash/to_a_spec.rb +0 -0
  273. data/spec/{core → rubyspec/core}/hash/to_json_spec.rb +0 -0
  274. data/spec/{core → rubyspec/core}/hash/to_native_spec.rb +0 -0
  275. data/spec/{core → rubyspec/core}/hash/update_spec.rb +0 -0
  276. data/spec/{core → rubyspec/core}/hash/value_spec.rb +0 -0
  277. data/spec/{core → rubyspec/core}/hash/values_at_spec.rb +0 -0
  278. data/spec/{core → rubyspec/core}/hash/values_spec.rb +0 -0
  279. data/spec/{core → rubyspec/core}/json/parse_spec.rb +0 -0
  280. data/spec/{core → rubyspec/core}/kernel/Array_spec.rb +0 -0
  281. data/spec/{core → rubyspec/core}/kernel/block_given.rb +0 -0
  282. data/spec/{core → rubyspec/core}/kernel/class_spec.rb +0 -0
  283. data/spec/{core → rubyspec/core}/kernel/define_singleton_method_spec.rb +0 -0
  284. data/spec/{core → rubyspec/core}/kernel/eql_spec.rb +0 -0
  285. data/spec/{core → rubyspec/core}/kernel/equal_spec.rb +0 -0
  286. data/spec/{core → rubyspec/core}/kernel/equal_value_spec.rb +0 -0
  287. data/spec/{core → rubyspec/core}/kernel/extend_spec.rb +0 -0
  288. data/spec/{core → rubyspec/core}/kernel/format_spec.rb +0 -0
  289. data/spec/{core → rubyspec/core}/kernel/instance_eval_spec.rb +0 -0
  290. data/spec/{core → rubyspec/core}/kernel/instance_variable_get_spec.rb +0 -0
  291. data/spec/{core → rubyspec/core}/kernel/instance_variable_set_spec.rb +0 -0
  292. data/spec/{core → rubyspec/core}/kernel/loop_spec.rb +0 -0
  293. data/spec/{core → rubyspec/core}/kernel/match_spec.rb +0 -0
  294. data/spec/{core → rubyspec/core}/kernel/method_spec.rb +0 -0
  295. data/spec/{core → rubyspec/core}/kernel/methods_spec.rb +0 -0
  296. data/spec/{core → rubyspec/core}/kernel/nil_spec.rb +0 -0
  297. data/spec/{core → rubyspec/core}/kernel/p_spec.rb +0 -0
  298. data/spec/{core → rubyspec/core}/kernel/printf_spec.rb +0 -0
  299. data/spec/{core → rubyspec/core}/kernel/proc_spec.rb +0 -0
  300. data/spec/{core → rubyspec/core}/kernel/rand_spec.rb +0 -0
  301. data/spec/{core → rubyspec/core}/kernel/respond_to_spec.rb +0 -0
  302. data/spec/{core → rubyspec/core}/kernel/send_spec.rb +0 -0
  303. data/spec/{core → rubyspec/core}/kernel/sprintf_spec.rb +0 -0
  304. data/spec/{core → rubyspec/core}/kernel/tap_spec.rb +0 -0
  305. data/spec/{core → rubyspec/core}/kernel/to_json_spec.rb +0 -0
  306. data/spec/{core → rubyspec/core}/kernel/to_s_spec.rb +0 -0
  307. data/spec/{core → rubyspec/core}/matchdata/to_a_spec.rb +0 -0
  308. data/spec/{core → rubyspec/core}/module/alias_method_spec.rb +0 -0
  309. data/spec/{core → rubyspec/core}/module/ancestors_spec.rb +0 -0
  310. data/spec/{core → rubyspec/core}/module/append_features_spec.rb +0 -0
  311. data/spec/{core → rubyspec/core}/module/const_get_spec.rb +0 -0
  312. data/spec/rubyspec/core/module/const_missing_spec.rb +18 -0
  313. data/spec/{core → rubyspec/core}/module/const_set_spec.rb +0 -0
  314. data/spec/{core → rubyspec/core}/module/fixtures/classes.rb +0 -0
  315. data/spec/{core → rubyspec/core}/module/method_defined_spec.rb +0 -0
  316. data/spec/{core → rubyspec/core}/module/module_function_spec.rb +0 -0
  317. data/spec/{core → rubyspec/core}/module/undef_method_spec.rb +0 -0
  318. data/spec/{core → rubyspec/core}/nil/and_spec.rb +0 -0
  319. data/spec/{core → rubyspec/core}/nil/dup_spec.rb +0 -0
  320. data/spec/{core → rubyspec/core}/nil/inspect_spec.rb +0 -0
  321. data/spec/{core → rubyspec/core}/nil/nil_spec.rb +0 -0
  322. data/spec/{core → rubyspec/core}/nil/or_spec.rb +0 -0
  323. data/spec/{core → rubyspec/core}/nil/to_a_spec.rb +0 -0
  324. data/spec/{core → rubyspec/core}/nil/to_f_spec.rb +0 -0
  325. data/spec/{core → rubyspec/core}/nil/to_h_spec.rb +0 -0
  326. data/spec/{core → rubyspec/core}/nil/to_i_spec.rb +0 -0
  327. data/spec/{core → rubyspec/core}/nil/to_s_spec.rb +0 -0
  328. data/spec/{core → rubyspec/core}/nil/xor_spec.rb +0 -0
  329. data/spec/{core → rubyspec/core}/numeric/abs_spec.rb +0 -0
  330. data/spec/{core → rubyspec/core}/numeric/bit_and_spec.rb +0 -0
  331. data/spec/{core → rubyspec/core}/numeric/bit_or_spec.rb +0 -0
  332. data/spec/{core → rubyspec/core}/numeric/bit_xor_spec.rb +0 -0
  333. data/spec/{core → rubyspec/core}/numeric/ceil_spec.rb +0 -0
  334. data/spec/{core → rubyspec/core}/numeric/chr_spec.rb +0 -0
  335. data/spec/{core → rubyspec/core}/numeric/comparison_spec.rb +0 -0
  336. data/spec/{core → rubyspec/core}/numeric/complement_spec.rb +0 -0
  337. data/spec/{core → rubyspec/core}/numeric/divide_spec.rb +0 -0
  338. data/spec/{core → rubyspec/core}/numeric/downto_spec.rb +0 -0
  339. data/spec/{core → rubyspec/core}/numeric/eql_spec.rb +0 -0
  340. data/spec/{core → rubyspec/core}/numeric/equal_value_spec.rb +0 -0
  341. data/spec/{core → rubyspec/core}/numeric/even_spec.rb +0 -0
  342. data/spec/{core → rubyspec/core}/numeric/exponent_spec.rb +0 -0
  343. data/spec/{core → rubyspec/core}/numeric/floor_spec.rb +0 -0
  344. data/spec/{core → rubyspec/core}/numeric/gt_spec.rb +0 -0
  345. data/spec/{core → rubyspec/core}/numeric/gte_spec.rb +0 -0
  346. data/spec/{core → rubyspec/core}/numeric/integer_spec.rb +0 -0
  347. data/spec/{core → rubyspec/core}/numeric/left_shift_spec.rb +0 -0
  348. data/spec/{core → rubyspec/core}/numeric/lt_spec.rb +0 -0
  349. data/spec/{core → rubyspec/core}/numeric/lte_spec.rb +0 -0
  350. data/spec/{core → rubyspec/core}/numeric/magnitude_spec.rb +0 -0
  351. data/spec/{core → rubyspec/core}/numeric/minus_spec.rb +0 -0
  352. data/spec/{core → rubyspec/core}/numeric/modulo_spec.rb +0 -0
  353. data/spec/{core → rubyspec/core}/numeric/multiply_spec.rb +0 -0
  354. data/spec/{core → rubyspec/core}/numeric/next_spec.rb +0 -0
  355. data/spec/{core → rubyspec/core}/numeric/odd_spec.rb +0 -0
  356. data/spec/{core → rubyspec/core}/numeric/ord_spec.rb +0 -0
  357. data/spec/{core → rubyspec/core}/numeric/plus_spec.rb +0 -0
  358. data/spec/{core → rubyspec/core}/numeric/pred_spec.rb +0 -0
  359. data/spec/{core → rubyspec/core}/numeric/right_shift_spec.rb +0 -0
  360. data/spec/{core → rubyspec/core}/numeric/succ_spec.rb +0 -0
  361. data/spec/{core → rubyspec/core}/numeric/times_spec.rb +0 -0
  362. data/spec/{core → rubyspec/core}/numeric/to_f_spec.rb +0 -0
  363. data/spec/{core → rubyspec/core}/numeric/to_i_spec.rb +0 -0
  364. data/spec/{core → rubyspec/core}/numeric/to_json_spec.rb +0 -0
  365. data/spec/{core → rubyspec/core}/numeric/to_s_spec.rb +0 -0
  366. data/spec/{core → rubyspec/core}/numeric/uminus_spec.rb +0 -0
  367. data/spec/{core → rubyspec/core}/numeric/upto_spec.rb +0 -0
  368. data/spec/{core → rubyspec/core}/numeric/zero_spec.rb +0 -0
  369. data/spec/{core → rubyspec/core}/proc/call_spec.rb +0 -0
  370. data/spec/{core → rubyspec/core}/proc/element_reference_spec.rb +0 -0
  371. data/spec/{core → rubyspec/core}/proc/proc_tricks_spec.rb +0 -0
  372. data/spec/{core → rubyspec/core}/range/begin_spec.rb +0 -0
  373. data/spec/{core → rubyspec/core}/range/case_compare_spec.rb +0 -0
  374. data/spec/{core → rubyspec/core}/range/end_spec.rb +0 -0
  375. data/spec/{core → rubyspec/core}/regexp/match_spec.rb +0 -0
  376. data/spec/{core → rubyspec/core}/runtime/call_spec.rb +0 -0
  377. data/spec/{core → rubyspec/core}/runtime/class_hierarchy_spec.rb +0 -0
  378. data/spec/{core → rubyspec/core}/runtime/def_spec.rb +0 -0
  379. data/spec/{core → rubyspec/core}/runtime/defined_spec.rb +0 -0
  380. data/spec/{core → rubyspec/core}/runtime/super_spec.rb +0 -0
  381. data/spec/{core → rubyspec/core}/string/capitalize_spec.rb +0 -0
  382. data/spec/{core → rubyspec/core}/string/casecmp_spec.rb +0 -0
  383. data/spec/{core → rubyspec/core}/string/chomp_spec.rb +0 -0
  384. data/spec/{core → rubyspec/core}/string/chop_spec.rb +0 -0
  385. data/spec/{core → rubyspec/core}/string/chr_spec.rb +0 -0
  386. data/spec/{core → rubyspec/core}/string/comparison_spec.rb +0 -0
  387. data/spec/{core → rubyspec/core}/string/demodulize_spec.rb +0 -0
  388. data/spec/{core → rubyspec/core}/string/downcase_spec.rb +0 -0
  389. data/spec/{core → rubyspec/core}/string/element_reference_spec.rb +0 -0
  390. data/spec/{core → rubyspec/core}/string/empty_spec.rb +0 -0
  391. data/spec/{core → rubyspec/core}/string/end_with_spec.rb +0 -0
  392. data/spec/{core → rubyspec/core}/string/fixtures/classes.rb +0 -0
  393. data/spec/{core → rubyspec/core}/string/format_spec.rb +0 -0
  394. data/spec/{core → rubyspec/core}/string/gsub_spec.rb +0 -0
  395. data/spec/{core → rubyspec/core}/string/include_spec.rb +0 -0
  396. data/spec/{core → rubyspec/core}/string/intern_spec.rb +0 -0
  397. data/spec/{core → rubyspec/core}/string/length_spec.rb +0 -0
  398. data/spec/{core → rubyspec/core}/string/lstrip_spec.rb +0 -0
  399. data/spec/{core → rubyspec/core}/string/match_spec.rb +0 -0
  400. data/spec/{core → rubyspec/core}/string/next_spec.rb +0 -0
  401. data/spec/{core → rubyspec/core}/string/ord_spec.rb +0 -0
  402. data/spec/{core → rubyspec/core}/string/partition_spec.rb +0 -0
  403. data/spec/{core → rubyspec/core}/string/reverse_spec.rb +0 -0
  404. data/spec/{core → rubyspec/core}/string/rstrip_spec.rb +0 -0
  405. data/spec/{core → rubyspec/core}/string/size_spec.rb +0 -0
  406. data/spec/{core → rubyspec/core}/string/slice_spec.rb +0 -0
  407. data/spec/{core → rubyspec/core}/string/split_spec.rb +0 -0
  408. data/spec/{core → rubyspec/core}/string/start_with_spec.rb +0 -0
  409. data/spec/{core → rubyspec/core}/string/strip_spec.rb +0 -0
  410. data/spec/{core → rubyspec/core}/string/sub_spec.rb +0 -0
  411. data/spec/{core → rubyspec/core}/string/succ_spec.rb +0 -0
  412. data/spec/{core → rubyspec/core}/string/sum_spec.rb +0 -0
  413. data/spec/{core → rubyspec/core}/string/swapcase_spec.rb +0 -0
  414. data/spec/{core → rubyspec/core}/string/to_a_spec.rb +0 -0
  415. data/spec/{core → rubyspec/core}/string/to_f_spec.rb +0 -0
  416. data/spec/{core → rubyspec/core}/string/to_i_spec.rb +0 -0
  417. data/spec/{core → rubyspec/core}/string/to_json_spec.rb +0 -0
  418. data/spec/{core → rubyspec/core}/string/to_s_spec.rb +0 -0
  419. data/spec/{core → rubyspec/core}/string/to_str_spec.rb +0 -0
  420. data/spec/{core → rubyspec/core}/string/to_sym_spec.rb +0 -0
  421. data/spec/{core → rubyspec/core}/string/underscore_spec.rb +0 -0
  422. data/spec/{core → rubyspec/core}/string/upcase_spec.rb +0 -0
  423. data/spec/{core → rubyspec/core}/symbol/to_proc_spec.rb +0 -0
  424. data/spec/{core → rubyspec/core}/time/at_spec.rb +0 -0
  425. data/spec/{core → rubyspec/core}/time/day_spec.rb +0 -0
  426. data/spec/{core → rubyspec/core}/time/friday_spec.rb +0 -0
  427. data/spec/{core → rubyspec/core}/time/hour_spec.rb +0 -0
  428. data/spec/{core → rubyspec/core}/time/min_spec.rb +0 -0
  429. data/spec/{core → rubyspec/core}/time/monday_spec.rb +0 -0
  430. data/spec/{core → rubyspec/core}/time/month_spec.rb +0 -0
  431. data/spec/{core → rubyspec/core}/time/now_spec.rb +0 -0
  432. data/spec/{core → rubyspec/core}/time/saturday_spec.rb +0 -0
  433. data/spec/{core → rubyspec/core}/true/and_spec.rb +0 -0
  434. data/spec/{core → rubyspec/core}/true/inspect_spec.rb +0 -0
  435. data/spec/{core → rubyspec/core}/true/or_spec.rb +0 -0
  436. data/spec/{core → rubyspec/core}/true/to_s_spec.rb +0 -0
  437. data/spec/{core → rubyspec/core}/true/xor_spec.rb +0 -0
  438. data/spec/rubyspec/filters/bugs/alias.rb +6 -0
  439. data/spec/{filters → rubyspec/filters/bugs}/ancestors.rb +0 -0
  440. data/spec/rubyspec/filters/bugs/array.rb +5 -0
  441. data/spec/{filters → rubyspec/filters/bugs}/array_delete.rb +0 -0
  442. data/spec/{filters → rubyspec/filters/bugs}/array_fetch.rb +0 -0
  443. data/spec/{filters → rubyspec/filters/bugs}/array_first.rb +0 -0
  444. data/spec/{filters → rubyspec/filters/bugs}/array_flatten.rb +0 -0
  445. data/spec/{filters → rubyspec/filters/bugs}/array_intersection.rb +0 -0
  446. data/spec/{filters → rubyspec/filters/bugs}/array_join.rb +0 -0
  447. data/spec/{filters → rubyspec/filters/bugs}/block_args.rb +0 -0
  448. data/spec/rubyspec/filters/bugs/break.rb +10 -0
  449. data/spec/rubyspec/filters/bugs/case.rb +8 -0
  450. data/spec/{filters → rubyspec/filters/bugs}/coerce_integer.rb +0 -0
  451. data/spec/rubyspec/filters/bugs/kernel/instance_variables.rb +3 -0
  452. data/spec/rubyspec/filters/bugs/language/class.rb +11 -0
  453. data/spec/rubyspec/filters/bugs/language/class_variables.rb +12 -0
  454. data/spec/rubyspec/filters/bugs/module/class_variables.rb +6 -0
  455. data/spec/rubyspec/filters/bugs/public_methods.rb +3 -0
  456. data/spec/{filters → rubyspec/filters/mspec}/mocks.rb +0 -0
  457. data/spec/rubyspec/filters/mspec/ruby_exe.rb +5 -0
  458. data/spec/{filters → rubyspec/filters/mspec}/should_receive.rb +1 -0
  459. data/spec/rubyspec/filters/parser/block_args.rb +51 -0
  460. data/spec/{filters → rubyspec/filters/unsupported}/array_subclasses.rb +0 -0
  461. data/spec/{filters → rubyspec/filters/unsupported}/frozen.rb +0 -0
  462. data/spec/{filters → rubyspec/filters/unsupported}/tainted.rb +0 -0
  463. data/spec/{fixtures → rubyspec/fixtures}/class.rb +0 -0
  464. data/spec/{fixtures → rubyspec/fixtures}/class_variables.rb +0 -0
  465. data/spec/rubyspec/fixtures/constants.rb +20 -0
  466. data/spec/{language → rubyspec/language}/alias_spec.rb +7 -7
  467. data/spec/{language → rubyspec/language}/and_spec.rb +0 -0
  468. data/spec/{language → rubyspec/language}/array_spec.rb +3 -3
  469. data/spec/{language → rubyspec/language}/block_spec.rb +59 -59
  470. data/spec/{language → rubyspec/language}/break_spec.rb +15 -19
  471. data/spec/{language → rubyspec/language}/case_spec.rb +6 -6
  472. data/spec/{language → rubyspec/language}/class_spec.rb +16 -18
  473. data/spec/{language → rubyspec/language}/class_variable_spec.rb +10 -10
  474. data/spec/{language → rubyspec/language}/def_spec.rb +0 -0
  475. data/spec/{language → rubyspec/language}/defined_spec.rb +2 -2
  476. data/spec/{language → rubyspec/language}/ensure_spec.rb +0 -0
  477. data/spec/{language → rubyspec/language}/execution_spec.rb +0 -0
  478. data/spec/{language → rubyspec/language}/fixtures/array.rb +0 -0
  479. data/spec/{language → rubyspec/language}/fixtures/block.rb +0 -0
  480. data/spec/{language → rubyspec/language}/fixtures/break.rb +0 -0
  481. data/spec/{language → rubyspec/language}/fixtures/ensure.rb +0 -0
  482. data/spec/{language → rubyspec/language}/fixtures/literal_lambda.rb +0 -0
  483. data/spec/{language → rubyspec/language}/fixtures/metaclass.rb +0 -0
  484. data/spec/{language → rubyspec/language}/fixtures/module.rb +0 -0
  485. data/spec/{language → rubyspec/language}/fixtures/next.rb +0 -0
  486. data/spec/{language → rubyspec/language}/fixtures/return.rb +0 -0
  487. data/spec/{language → rubyspec/language}/fixtures/send.rb +0 -0
  488. data/spec/{language → rubyspec/language}/fixtures/send_1.9.rb +0 -0
  489. data/spec/{language → rubyspec/language}/fixtures/super.rb +0 -0
  490. data/spec/{language → rubyspec/language}/fixtures/variables.rb +0 -0
  491. data/spec/{language → rubyspec/language}/fixtures/yield.rb +0 -0
  492. data/spec/{language → rubyspec/language}/for_spec.rb +0 -0
  493. data/spec/{language → rubyspec/language}/hash_spec.rb +0 -0
  494. data/spec/{language → rubyspec/language}/if_spec.rb +0 -0
  495. data/spec/{language → rubyspec/language}/literal_lambda_spec.rb +0 -0
  496. data/spec/{language → rubyspec/language}/loop_spec.rb +0 -0
  497. data/spec/{language → rubyspec/language}/metaclass_spec.rb +0 -0
  498. data/spec/{language → rubyspec/language}/module_spec.rb +0 -0
  499. data/spec/{language → rubyspec/language}/next_spec.rb +0 -0
  500. data/spec/{language → rubyspec/language}/not_spec.rb +0 -0
  501. data/spec/{language → rubyspec/language}/numbers_spec.rb +0 -0
  502. data/spec/{language → rubyspec/language}/or_spec.rb +0 -0
  503. data/spec/{language → rubyspec/language}/order_spec.rb +0 -0
  504. data/spec/{language → rubyspec/language}/precedence_spec.rb +0 -0
  505. data/spec/{language → rubyspec/language}/predefined_spec.rb +0 -0
  506. data/spec/{language → rubyspec/language}/proc_spec.rb +0 -0
  507. data/spec/{language → rubyspec/language}/redo_spec.rb +0 -0
  508. data/spec/{language → rubyspec/language}/regexp_spec.rb +0 -0
  509. data/spec/{language → rubyspec/language}/rescue_spec.rb +0 -0
  510. data/spec/{language → rubyspec/language}/retry_spec.rb +0 -0
  511. data/spec/{language → rubyspec/language}/return_spec.rb +0 -0
  512. data/spec/{language → rubyspec/language}/send_spec.rb +0 -1
  513. data/spec/{language → rubyspec/language}/singleton_class_spec.rb +0 -0
  514. data/spec/{language → rubyspec/language}/string_spec.rb +0 -0
  515. data/spec/{language → rubyspec/language}/super_spec.rb +0 -0
  516. data/spec/{language → rubyspec/language}/symbol_spec.rb +0 -0
  517. data/spec/{language → rubyspec/language}/undef_spec.rb +0 -0
  518. data/spec/{language → rubyspec/language}/unless_spec.rb +0 -0
  519. data/spec/{language → rubyspec/language}/until_spec.rb +0 -0
  520. data/spec/{language → rubyspec/language}/variables_spec.rb +3 -3
  521. data/spec/{language → rubyspec/language}/versions/array_1.9.rb +0 -0
  522. data/spec/{language → rubyspec/language}/versions/case_1.9.rb +0 -0
  523. data/spec/{language → rubyspec/language}/versions/hash_1.9.rb +0 -0
  524. data/spec/{language → rubyspec/language}/versions/literal_lambda_1.9.rb +0 -0
  525. data/spec/{language → rubyspec/language}/versions/not_1.9.rb +0 -0
  526. data/spec/{language → rubyspec/language}/versions/send_1.9.rb +0 -0
  527. data/spec/{language → rubyspec/language}/versions/symbol_1.9.rb +0 -0
  528. data/spec/{language → rubyspec/language}/versions/variables_1.9.rb +0 -0
  529. data/spec/{language → rubyspec/language}/while_spec.rb +0 -0
  530. data/spec/{language → rubyspec/language}/yield_spec.rb +0 -0
  531. data/spec/{library → rubyspec/library}/date/new_spec.rb +0 -0
  532. data/spec/{library → rubyspec/library}/date/to_s_spec.rb +0 -0
  533. data/spec/{library → rubyspec/library}/date/today_spec.rb +0 -0
  534. data/spec/rubyspec/library/observer/add_observer_spec.rb +31 -0
  535. data/spec/rubyspec/library/observer/count_observers_spec.rb +33 -0
  536. data/spec/rubyspec/library/observer/delete_observer_spec.rb +19 -0
  537. data/spec/rubyspec/library/observer/delete_observers_spec.rb +19 -0
  538. data/spec/rubyspec/library/observer/fixtures/classes.rb +25 -0
  539. data/spec/rubyspec/library/observer/notify_observers_spec.rb +31 -0
  540. data/spec/rubyspec/spec_helper.rb +59 -0
  541. data/spec/simple_erb_template.opalerb +1 -0
  542. data/spec/spec_helper.rb +0 -59
  543. data/spec/templates/foo/bar.opalerb +1 -0
  544. data/spec/templates/prefixed.opalerb +1 -0
  545. metadata +1028 -961
  546. data/opal/opal/browser_loader.js +0 -57
  547. data/spec/core_ext/native/fixtures/classes.rb +0 -5
  548. data/spec/core_ext/native/initialize_spec.rb +0 -8
  549. data/spec/core_ext/native/method_missing_spec.rb +0 -8
  550. data/spec/date.rb +0 -0
  551. data/spec/fixtures/constants.rb +0 -0
  552. data/spec/ospec/filter.rb +0 -32
  553. data/spec/ospec/phantom.rb +0 -97
@@ -0,0 +1,10 @@
1
+ opal_filter "break" do
2
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from the scope creating the block"
3
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from a method"
4
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when yielding to the block"
5
+ fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when calling the block from a method"
6
+ fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when yielding to the block"
7
+ fails "The break statement in a lambda when the invocation of the scope creating the lambda is still active raises a LocalJumpError when yielding to a lambda passed as a block argument"
8
+ fails "The break statement in a lambda from a scope that has returned raises a LocalJumpError when yielding to a lambda passed as a block argument"
9
+ fails "Executing break from within a block returns from the original invoking method even in case of chained calls"
10
+ end
@@ -0,0 +1,8 @@
1
+ opal_filter "case" do
2
+ fails "The 'case'-construct lets you define a method after the case statement"
3
+ fails "The 'case'-construct with no target expression evaluates the body of the first clause when at least one of its condition expressions is true"
4
+ fails "The 'case'-construct with no target expression evaluates the body of the first when clause that is not false/nil"
5
+ fails "The 'case'-construct with no target expression evaluates the body of the else clause if all when clauses are false/nil"
6
+ fails "The 'case'-construct with no target expression evaluates multiple conditional expressions as a boolean disjunction"
7
+ fails "The 'case'-construct with no target expression evaluates true as only 'true' when true is the first clause"
8
+ end
@@ -0,0 +1,3 @@
1
+ opal_filter "Kernel#instance_variables" do
2
+ fails "A class definition allows the definition of class-level instance variables in a class method"
3
+ end
@@ -0,0 +1,11 @@
1
+ opal_filter "class" do
2
+ fails "A class definition raises TypeError if constant given as class name exists and is not a Module"
3
+ fails "A class definition raises TypeError if the constant qualifying the class is nil"
4
+ fails "A class definition raises TypeError if any constant qualifying the class is not a Module"
5
+ fails "A class definition allows using self as the superclass if self is a class"
6
+ fails "A class definition raises a TypeError if inheriting from a metaclass"
7
+ fails "A class definition extending an object (sclass) raises a TypeError when trying to extend numbers"
8
+ fails "A class definition extending an object (sclass) allows accessing the block of the original scope"
9
+ fails "A class definition extending an object (sclass) can use return to cause the enclosing method to return"
10
+ fails "Reopening a class raises a TypeError when superclasses mismatch"
11
+ end
@@ -0,0 +1,12 @@
1
+ opal_filter "class_variables" do
2
+ fails "A class variable can be accessed from a subclass"
3
+ fails "A class variable is set in the superclass"
4
+ fails "A class variable defined in a module can be accessed from classes that extend the module"
5
+ fails "A class variable defined in a module is not defined in these classes"
6
+ fails "A class variable defined in a module is only updated in the module a method defined in the module is used"
7
+ fails "A class variable defined in a module is updated in the class when a Method defined in the class is used"
8
+ fails "A class variable defined in a module can be accessed inside the class using the module methods"
9
+ fails "A class variable defined in a module can be accessed from modules that extend the module"
10
+ fails "A class variable defined in a module is defined in the extended module"
11
+ fails "A class variable defined in a module is not defined in the extending module"
12
+ end
@@ -0,0 +1,6 @@
1
+ opal_filter "Module#class_variables" do
2
+ fails "A class definition has no class variables"
3
+ fails "A class definition allows the declaration of class variables in the body"
4
+ fails "A class definition allows the declaration of class variables in a class method"
5
+ fails "A class definition allows the declaration of class variables in an instance method"
6
+ end
@@ -0,0 +1,3 @@
1
+ opal_filter "Module#public_methods" do
2
+ fails "The alias keyword adds the new method to the list of public methods"
3
+ end
File without changes
@@ -0,0 +1,5 @@
1
+ opal_filter "ruby_exe" do
2
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from the toplevel"
3
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from a method"
4
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from a block"
5
+ end
@@ -1,4 +1,5 @@
1
1
  opal_filter "should_receive" do
2
2
  fails "Array#at tries to convert the passed argument to an Integer using #to_int"
3
3
  fails "Array#include? calls == on elements from left to right until success"
4
+ fails "A block taking |a| arguments does not call #to_ary to convert a single yielded object to an Array"
4
5
  end
@@ -0,0 +1,51 @@
1
+ opal_filter "block args" do
2
+ fails "A block allows for a leading space before the arguments"
3
+ fails "A block taking |a, b| arguments assigns 'nil' and 'nil' to the arguments when a single, empty Array is yielded"
4
+ fails "A block taking |a, b| arguments assigns the element of a single element Array to the first argument"
5
+ fails "A block taking |a, b| arguments destructures a single Array value yielded"
6
+ fails "A block taking |a, b| arguments calls #to_ary to convert a single yielded object to an Array"
7
+ fails "A block taking |a, b| arguments does not call #to_ary if the single yielded object is an Array"
8
+ fails "A block taking |a, b| arguments raises an TypeError if #to_ary does not return an Array"
9
+ fails "A block taking |a, *b| arguments assigns 'nil' and '[]' to the arguments when a single, empty Array is yielded"
10
+ fails "A block taking |a, *b| arguments assigns the element of a single element Array to the first argument"
11
+ fails "A block taking |a, *b| arguments destructures a single Array value assigning the remaining values to the rest argument"
12
+ fails "A block taking |a, *b| arguments calls #to_ary to convert a single yielded object to an Array"
13
+ fails "A block taking |a, *b| arguments does not call #to_ary if the single yielded object is an Array"
14
+ fails "A block taking |a, *b| arguments raises an TypeError if #to_ary does not return an Array"
15
+ fails "A block taking |*| arguments does not raise an exception when no values are yielded"
16
+ fails "A block taking |*| arguments does not raise an exception when values are yielded"
17
+ fails "A block taking |*| arguments does not call #to_ary if the single yielded object is an Array"
18
+ fails "A block taking |*| arguments does not call #to_ary if the object does not respond to #to_ary"
19
+ fails "A block taking |*a| arguments does not call #to_ary if the single yielded object is an Array"
20
+ fails "A block taking |a, | arguments assigns nil to the argument when no values are yielded"
21
+ fails "A block taking |a, | arguments assgins the argument a single value yielded"
22
+ fails "A block taking |a, | arguments assigns the argument the first value yielded"
23
+ fails "A block taking |a, | arguments assigns the argument the first of several values yielded when it is an Array"
24
+ fails "A block taking |a, | arguments assigns nil to the argument when passed an empty Array"
25
+ fails "A block taking |a, | arguments assigns the argument the first element of the Array when passed a single Array"
26
+ fails "A block taking |a, | arguments calls #to_ary to convert a single yielded object to an Array"
27
+ fails "A block taking |a, | arguments does not call #to_ary if the single yielded object is an Array"
28
+ fails "A block taking |a, | arguments does not call #to_ary if the object does not respond to #to_ary"
29
+ fails "A block taking |a, | arguments raises an TypeError if #to_ary does not return an Array"
30
+ fails "A block taking |(a, b)| arguments assigns nil to the arguments when yielded no values"
31
+ fails "A block taking |(a, b)| arguments destructures a single Array value yielded"
32
+ fails "A block taking |(a, b)| arguments calls #to_ary to convert a single yielded object to an Array"
33
+ fails "A block taking |(a, b)| arguments does not call #to_ary if the single yielded object is an Array"
34
+ fails "A block taking |(a, b)| arguments does not call #to_ary if the object does not respond to #to_ary"
35
+ fails "A block taking |(a, b)| arguments raises an TypeError if #to_ary does not return an Array"
36
+ fails "A block taking |(a, b), c| arguments assigns nil to the arguments when yielded no values"
37
+ fails "A block taking |(a, b), c| arguments destructures a single one-level Array value yielded"
38
+ fails "A block taking |(a, b), c| arguments destructures a single multi-level Array value yielded"
39
+ fails "A block taking |(a, b), c| arguments calls #to_ary to convert a single yielded object to an Array"
40
+ fails "A block taking |(a, b), c| arguments does not call #to_ary if the single yielded object is an Array"
41
+ fails "A block taking |(a, b), c| arguments does not call #to_ary if the object does not respond to #to_ary"
42
+ fails "A block taking |(a, b), c| arguments raises an TypeError if #to_ary does not return an Array"
43
+ fails "A block taking nested |a, (b, (c, d))| assigns nil to the arguments when yielded no values"
44
+ fails "A block taking nested |a, (b, (c, d))| destructures separate yielded values"
45
+ fails "A block taking nested |a, (b, (c, d))| destructures a single multi-level Array value yielded"
46
+ fails "A block taking nested |a, (b, (c, d))| destructures a single multi-level Array value yielded"
47
+ fails "A block taking nested |a, ((b, c), d)| assigns nil to the arguments when yielded no values"
48
+ fails "A block taking nested |a, ((b, c), d)| destructures separate yielded values"
49
+ fails "A block taking nested |a, ((b, c), d)| destructures a single multi-level Array value yielded"
50
+ fails "A block taking nested |a, ((b, c), d)| destructures a single multi-level Array value yielded"
51
+ end
File without changes
@@ -0,0 +1,20 @@
1
+ module ConstantSpecs
2
+ class ClassA
3
+ CS_CONST10 = :const10_10
4
+ CS_CONST16 = :const16
5
+ CS_CONST17 = :const17_2
6
+ CS_CONST22 = :const22_1
7
+
8
+ def self.const_missing(const)
9
+ const
10
+ end
11
+
12
+ def self.constx; CS_CONSTX; end
13
+ def self.const10; CS_CONST10; end
14
+ def self.const16; ParentA.const16; end
15
+ def self.const22; ParentA.const22 { CS_CONST22 }; end
16
+
17
+ def const10; CS_CONST10; end
18
+ def constx; CS_CONSTX; end
19
+ end
20
+ end
@@ -31,7 +31,7 @@ describe "The alias keyword" do
31
31
  (@obj.methods - original_methods).map {|m| m.to_s }.should == ["__value"]
32
32
  end
33
33
 
34
- pending "adds the new method to the list of public methods" do
34
+ it "adds the new method to the list of public methods" do
35
35
  original_methods = @obj.public_methods
36
36
  @meta.class_eval do
37
37
  alias __value value
@@ -59,7 +59,7 @@ describe "The alias keyword" do
59
59
  @obj.value.should == 5
60
60
  end
61
61
 
62
- pending "operates on the object's metaclass when used in instance_eval" do
62
+ it "operates on the object's metaclass when used in instance_eval" do
63
63
  @obj.instance_eval do
64
64
  alias __value value
65
65
  end
@@ -68,7 +68,7 @@ describe "The alias keyword" do
68
68
  lambda { AliasObject.new.__value }.should raise_error(NoMethodError)
69
69
  end
70
70
 
71
- pending "operates on methods defined via attr, attr_reader, and attr_accessor" do
71
+ it "operates on methods defined via attr, attr_reader, and attr_accessor" do
72
72
  @obj.prep
73
73
  @obj.instance_eval do
74
74
  alias afoo foo
@@ -82,7 +82,7 @@ describe "The alias keyword" do
82
82
  @obj.abaz.should == 5
83
83
  end
84
84
 
85
- pending "operates on methods with splat arguments" do
85
+ it "operates on methods with splat arguments" do
86
86
  class AliasObject2;end
87
87
  AliasObject2.class_eval do
88
88
  def test(*args)
@@ -111,7 +111,7 @@ describe "The alias keyword" do
111
111
  @obj.test(1,2,3,4,5).should == 4
112
112
  end
113
113
 
114
- pending "operates on methods with splat arguments defined in a superclass" do
114
+ it "operates on methods with splat arguments defined in a superclass" do
115
115
  class AliasObject3;end
116
116
  class Sub3 < AliasObject3;end
117
117
  AliasObject3.class_eval do
@@ -129,7 +129,7 @@ describe "The alias keyword" do
129
129
  Sub3.new.test(1,2,3,4,5).should == 4
130
130
  end
131
131
 
132
- pending "operates on methods with splat arguments defined in a superclass using text block for class eval" do
132
+ it "operates on methods with splat arguments defined in a superclass using text block for class eval" do
133
133
  class Sub < AliasObject;end
134
134
  AliasObject.class_eval <<-code
135
135
  def test(*args)
@@ -144,7 +144,7 @@ describe "The alias keyword" do
144
144
  Sub.new.test("testing").should == 4
145
145
  end
146
146
 
147
- pending "is not allowed against Fixnum or String instances" do
147
+ it "is not allowed against Fixnum or String instances" do
148
148
  lambda do
149
149
  1.instance_eval do
150
150
  alias :foo :to_s
File without changes
@@ -67,14 +67,14 @@ describe "The unpacking splat operator (*)" do
67
67
  end
68
68
 
69
69
  ruby_bug "#5124", "1.9.3.194" do
70
- pending "returns a new array containing the same values when applied to an array inside an empty array" do
70
+ it "returns a new array containing the same values when applied to an array inside an empty array" do
71
71
  splatted_array = [3, 4, 5]
72
72
  [*splatted_array].should == splatted_array
73
73
  [*splatted_array].should_not equal(splatted_array)
74
74
  end
75
75
  end
76
76
 
77
- pending "unpacks the start and count arguments in an array slice assignment" do
77
+ it "unpacks the start and count arguments in an array slice assignment" do
78
78
  alphabet_1 = ['a'..'z'].to_a
79
79
  alphabet_2 = alphabet_1.dup
80
80
  start_and_count_args = [1, 10]
@@ -85,7 +85,7 @@ describe "The unpacking splat operator (*)" do
85
85
  alphabet_1.should == alphabet_2
86
86
  end
87
87
 
88
- pending "unpacks arguments as if they were listed statically" do
88
+ it "unpacks arguments as if they were listed statically" do
89
89
  static = [1,2,3,4]
90
90
  receiver = static.dup
91
91
  args = [0,1]
@@ -11,12 +11,12 @@ describe "A block" do
11
11
  @y.z { var }.should == 1
12
12
  end
13
13
 
14
- pending "allows for a leading space before the arguments" do
14
+ it "allows for a leading space before the arguments" do
15
15
  # res = @y.s (:a){ 1 }
16
16
  # res.should == 1
17
17
  end
18
18
 
19
- pending "allows to define a block variable with the same name as the enclosing block" do
19
+ it "allows to define a block variable with the same name as the enclosing block" do
20
20
  o = BlockSpecs::OverwriteBlockVariable.new
21
21
  o.z { 1 }.should == 1
22
22
  end
@@ -66,7 +66,7 @@ describe "A block" do
66
66
  @y.s(1) { |a| a }.should == 1
67
67
  end
68
68
 
69
- pending "does not call #to_ary to convert a single yielded object to an Array" do
69
+ it "does not call #to_ary to convert a single yielded object to an Array" do
70
70
  obj = mock("block yield to_ary")
71
71
  obj.should_not_receive(:to_ary)
72
72
 
@@ -107,17 +107,17 @@ describe "A block" do
107
107
  @y.m([1, 2], 3, 4) { |a, b| [a, b] }.should == [[1, 2], 3]
108
108
  end
109
109
 
110
- pending "assigns 'nil' and 'nil' to the arguments when a single, empty Array is yielded" do
110
+ it "assigns 'nil' and 'nil' to the arguments when a single, empty Array is yielded" do
111
111
  @y.s([]) { |a, b| [a, b] }.should == [nil, nil]
112
112
  end
113
113
 
114
- pending "assigns the element of a single element Array to the first argument" do
114
+ it "assigns the element of a single element Array to the first argument" do
115
115
  @y.s([1]) { |a, b| [a, b] }.should == [1, nil]
116
116
  @y.s([nil]) { |a, b| [a, b] }.should == [nil, nil]
117
117
  @y.s([[]]) { |a, b| [a, b] }.should == [[], nil]
118
118
  end
119
119
 
120
- pending "destructures a single Array value yielded" do
120
+ it "destructures a single Array value yielded" do
121
121
  @y.s([1, 2, 3]) { |a, b| [a, b] }.should == [1, 2]
122
122
  end
123
123
 
@@ -129,20 +129,20 @@ describe "A block" do
129
129
  end
130
130
 
131
131
  ruby_version_is "1.9" do
132
- pending "destructures a splatted Array" do
132
+ it "destructures a splatted Array" do
133
133
  @y.r([[]]) { |a, b| [a, b] }.should == [nil, nil]
134
134
  @y.r([[1]]) { |a, b| [a, b] }.should == [1, nil]
135
135
  end
136
136
  end
137
137
 
138
- pending "calls #to_ary to convert a single yielded object to an Array" do
138
+ it "calls #to_ary to convert a single yielded object to an Array" do
139
139
  obj = mock("block yield to_ary")
140
140
  obj.should_receive(:to_ary).and_return([1, 2])
141
141
 
142
142
  @y.s(obj) { |a, b| [a, b] }.should == [1, 2]
143
143
  end
144
144
 
145
- pending "does not call #to_ary if the single yielded object is an Array" do
145
+ it "does not call #to_ary if the single yielded object is an Array" do
146
146
  obj = [1, 2]
147
147
  obj.should_not_receive(:to_ary)
148
148
 
@@ -155,7 +155,7 @@ describe "A block" do
155
155
  @y.s(obj) { |a, b| [a, b] }.should == [obj, nil]
156
156
  end
157
157
 
158
- pending "raises an TypeError if #to_ary does not return an Array" do
158
+ it "raises an TypeError if #to_ary does not return an Array" do
159
159
  obj = mock("block yield to_ary invalid")
160
160
  obj.should_receive(:to_ary).and_return(1)
161
161
 
@@ -172,11 +172,11 @@ describe "A block" do
172
172
  @y.m(1, 2, 3) { |a, *b| [a, b] }.should == [1, [2, 3]]
173
173
  end
174
174
 
175
- pending "assigns 'nil' and '[]' to the arguments when a single, empty Array is yielded" do
175
+ it "assigns 'nil' and '[]' to the arguments when a single, empty Array is yielded" do
176
176
  @y.s([]) { |a, *b| [a, b] }.should == [nil, []]
177
177
  end
178
178
 
179
- pending "assigns the element of a single element Array to the first argument" do
179
+ it "assigns the element of a single element Array to the first argument" do
180
180
  @y.s([1]) { |a, *b| [a, b] }.should == [1, []]
181
181
  @y.s([nil]) { |a, *b| [a, b] }.should == [nil, []]
182
182
  @y.s([[]]) { |a, *b| [a, b] }.should == [[], []]
@@ -190,24 +190,24 @@ describe "A block" do
190
190
  end
191
191
 
192
192
  ruby_version_is "1.9" do
193
- pending "destructures a splatted Array" do
193
+ it "destructures a splatted Array" do
194
194
  @y.r([[]]) { |a, *b| [a, b] }.should == [nil, []]
195
195
  @y.r([[1]]) { |a, *b| [a, b] }.should == [1, []]
196
196
  end
197
197
  end
198
198
 
199
- pending "destructures a single Array value assigning the remaining values to the rest argument" do
199
+ it "destructures a single Array value assigning the remaining values to the rest argument" do
200
200
  @y.s([1, 2, 3]) { |a, *b| [a, b] }.should == [1, [2, 3]]
201
201
  end
202
202
 
203
- pending "calls #to_ary to convert a single yielded object to an Array" do
203
+ it "calls #to_ary to convert a single yielded object to an Array" do
204
204
  obj = mock("block yield to_ary")
205
205
  obj.should_receive(:to_ary).and_return([1, 2])
206
206
 
207
207
  @y.s(obj) { |a, *b| [a, b] }.should == [1, [2]]
208
208
  end
209
209
 
210
- pending "does not call #to_ary if the single yielded object is an Array" do
210
+ it "does not call #to_ary if the single yielded object is an Array" do
211
211
  obj = [1, 2]
212
212
  obj.should_not_receive(:to_ary)
213
213
 
@@ -220,7 +220,7 @@ describe "A block" do
220
220
  @y.s(obj) { |a, *b| [a, b] }.should == [obj, []]
221
221
  end
222
222
 
223
- pending "raises an TypeError if #to_ary does not return an Array" do
223
+ it "raises an TypeError if #to_ary does not return an Array" do
224
224
  obj = mock("block yield to_ary invalid")
225
225
  obj.should_receive(:to_ary).and_return(1)
226
226
 
@@ -229,22 +229,22 @@ describe "A block" do
229
229
  end
230
230
 
231
231
  describe "taking |*| arguments" do
232
- pending "does not raise an exception when no values are yielded" do
232
+ it "does not raise an exception when no values are yielded" do
233
233
  # @y.z { |*| 1 }.should == 1
234
234
  end
235
235
 
236
- pending "does not raise an exception when values are yielded" do
236
+ it "does not raise an exception when values are yielded" do
237
237
  # @y.s(0) { |*| 1 }.should == 1
238
238
  end
239
239
 
240
- pending "does not call #to_ary if the single yielded object is an Array" do
240
+ it "does not call #to_ary if the single yielded object is an Array" do
241
241
  obj = [1, 2]
242
242
  obj.should_not_receive(:to_ary)
243
243
 
244
244
  # @y.s(obj) { |*| 1 }.should == 1
245
245
  end
246
246
 
247
- pending "does not call #to_ary if the object does not respond to #to_ary" do
247
+ it "does not call #to_ary if the object does not respond to #to_ary" do
248
248
  obj = mock("block yield no to_ary")
249
249
 
250
250
  # @y.s(obj) { |*| 1 }.should == 1
@@ -258,14 +258,14 @@ describe "A block" do
258
258
  # @y.s(obj) { |*| 1 }.should == 1
259
259
  end
260
260
 
261
- pending "does not raise a TypeError if #to_ary returns nil" do
261
+ it "does not raise a TypeError if #to_ary returns nil" do
262
262
  obj = mock("block yield to_ary nil")
263
263
  obj.should_receive(:to_ary).and_return(nil)
264
264
 
265
265
  # @y.s(obj) { |*o| o }.should == [obj]
266
266
  end
267
267
 
268
- pending "raises an TypeError if #to_ary does not return an Array" do
268
+ it "raises an TypeError if #to_ary does not return an Array" do
269
269
  obj = mock("block yield to_ary invalid")
270
270
  obj.should_receive(:to_ary).and_return(1)
271
271
 
@@ -274,7 +274,7 @@ describe "A block" do
274
274
  end
275
275
 
276
276
  ruby_version_is "1.9" do
277
- pending "does not call #to_ary to convert a single yielded object to an Array" do
277
+ it "does not call #to_ary to convert a single yielded object to an Array" do
278
278
  obj = mock("block yield to_ary")
279
279
  obj.should_not_receive(:to_ary)
280
280
 
@@ -304,7 +304,7 @@ describe "A block" do
304
304
  @y.s([1, 2, 3]) { |*a| a }.should == [[1, 2, 3]]
305
305
  end
306
306
 
307
- pending "does not call #to_ary if the single yielded object is an Array" do
307
+ it "does not call #to_ary if the single yielded object is an Array" do
308
308
  obj = [1, 2]
309
309
  obj.should_not_receive(:to_ary)
310
310
 
@@ -334,7 +334,7 @@ describe "A block" do
334
334
  end
335
335
 
336
336
  ruby_version_is "1.9" do
337
- pending "does not call #to_ary to convert a single yielded object to an Array" do
337
+ it "does not call #to_ary to convert a single yielded object to an Array" do
338
338
  obj = mock("block yield to_ary")
339
339
  obj.should_not_receive(:to_ary)
340
340
 
@@ -344,51 +344,51 @@ describe "A block" do
344
344
  end
345
345
 
346
346
  describe "taking |a, | arguments" do
347
- pending "assigns nil to the argument when no values are yielded" do
347
+ it "assigns nil to the argument when no values are yielded" do
348
348
  # @y.z { |a, | a }.should be_nil
349
349
  end
350
350
 
351
- pending "assgins the argument a single value yielded" do
351
+ it "assgins the argument a single value yielded" do
352
352
  # @y.s(1) { |a, | a }.should == 1
353
353
  end
354
354
 
355
- pending "assigns the argument the first value yielded" do
355
+ it "assigns the argument the first value yielded" do
356
356
  # @y.m(1, 2) { |a, | a }.should == 1
357
357
  end
358
358
 
359
- pending "assigns the argument the first of several values yielded when it is an Array" do
359
+ it "assigns the argument the first of several values yielded when it is an Array" do
360
360
  # @y.m([1, 2], 3) { |a, | a }.should == [1, 2]
361
361
  end
362
362
 
363
- pending "assigns nil to the argument when passed an empty Array" do
363
+ it "assigns nil to the argument when passed an empty Array" do
364
364
  # @y.s([]) { |a, | a }.should be_nil
365
365
  end
366
366
 
367
- pending "assigns the argument the first element of the Array when passed a single Array" do
367
+ it "assigns the argument the first element of the Array when passed a single Array" do
368
368
  # @y.s([1, 2]) { |a, | a }.should == 1
369
369
  end
370
370
 
371
- pending "calls #to_ary to convert a single yielded object to an Array" do
371
+ it "calls #to_ary to convert a single yielded object to an Array" do
372
372
  # obj = mock("block yield to_ary")
373
373
  # obj.should_receive(:to_ary).and_return([1, 2])
374
374
 
375
375
  # @y.s(obj) { |a, | a }.should == 1
376
376
  end
377
377
 
378
- pending "does not call #to_ary if the single yielded object is an Array" do
378
+ it "does not call #to_ary if the single yielded object is an Array" do
379
379
  # obj = [1, 2]
380
380
  # obj.should_not_receive(:to_ary)
381
381
 
382
382
  # @y.s(obj) { |a, | a }.should == 1
383
383
  end
384
384
 
385
- pending "does not call #to_ary if the object does not respond to #to_ary" do
385
+ it "does not call #to_ary if the object does not respond to #to_ary" do
386
386
  # obj = mock("block yield no to_ary")
387
387
 
388
388
  # @y.s(obj) { |a, | a }.should == obj
389
389
  end
390
390
 
391
- pending "raises an TypeError if #to_ary does not return an Array" do
391
+ it "raises an TypeError if #to_ary does not return an Array" do
392
392
  # obj = mock("block yield to_ary invalid")
393
393
  # obj.should_receive(:to_ary).and_return(1)
394
394
 
@@ -397,35 +397,35 @@ describe "A block" do
397
397
  end
398
398
 
399
399
  describe "taking |(a, b)| arguments" do
400
- pending "assigns nil to the arguments when yielded no values" do
400
+ it "assigns nil to the arguments when yielded no values" do
401
401
  # @y.z { |(a, b)| [a, b] }.should == [nil, nil]
402
402
  end
403
403
 
404
- pending "destructures a single Array value yielded" do
404
+ it "destructures a single Array value yielded" do
405
405
  # @y.s([1, 2]) { |(a, b)| [a, b] }.should == [1, 2]
406
406
  end
407
407
 
408
- pending "calls #to_ary to convert a single yielded object to an Array" do
408
+ it "calls #to_ary to convert a single yielded object to an Array" do
409
409
  obj = mock("block yield to_ary")
410
410
  obj.should_receive(:to_ary).and_return([1, 2])
411
411
 
412
412
  # @y.s(obj) { |(a, b)| [a, b] }.should == [1, 2]
413
413
  end
414
414
 
415
- pending "does not call #to_ary if the single yielded object is an Array" do
415
+ it "does not call #to_ary if the single yielded object is an Array" do
416
416
  obj = [1, 2]
417
417
  obj.should_not_receive(:to_ary)
418
418
 
419
419
  # @y.s(obj) { |(a, b)| [a, b] }.should == [1, 2]
420
420
  end
421
421
 
422
- pending "does not call #to_ary if the object does not respond to #to_ary" do
422
+ it "does not call #to_ary if the object does not respond to #to_ary" do
423
423
  obj = mock("block yield no to_ary")
424
424
 
425
425
  # @y.s(obj) { |(a, b)| [a, b] }.should == [obj, nil]
426
426
  end
427
427
 
428
- pending "raises an TypeError if #to_ary does not return an Array" do
428
+ it "raises an TypeError if #to_ary does not return an Array" do
429
429
  obj = mock("block yield to_ary invalid")
430
430
  obj.should_receive(:to_ary).and_return(1)
431
431
 
@@ -434,39 +434,39 @@ describe "A block" do
434
434
  end
435
435
 
436
436
  describe "taking |(a, b), c| arguments" do
437
- pending "assigns nil to the arguments when yielded no values" do
437
+ it "assigns nil to the arguments when yielded no values" do
438
438
  # @y.z { |(a, b), c| [a, b, c] }.should == [nil, nil, nil]
439
439
  end
440
440
 
441
- pending "destructures a single one-level Array value yielded" do
441
+ it "destructures a single one-level Array value yielded" do
442
442
  # @y.s([1, 2]) { |(a, b), c| [a, b, c] }.should == [1, nil, 2]
443
443
  end
444
444
 
445
- pending "destructures a single multi-level Array value yielded" do
445
+ it "destructures a single multi-level Array value yielded" do
446
446
  # @y.s([[1, 2, 3], 4]) { |(a, b), c| [a, b, c] }.should == [1, 2, 4]
447
447
  end
448
448
 
449
- pending "calls #to_ary to convert a single yielded object to an Array" do
449
+ it "calls #to_ary to convert a single yielded object to an Array" do
450
450
  obj = mock("block yield to_ary")
451
451
  obj.should_receive(:to_ary).and_return([1, 2])
452
452
 
453
453
  # @y.s(obj) { |(a, b), c| [a, b, c] }.should == [1, nil, 2]
454
454
  end
455
455
 
456
- pending "does not call #to_ary if the single yielded object is an Array" do
456
+ it "does not call #to_ary if the single yielded object is an Array" do
457
457
  obj = [1, 2]
458
458
  obj.should_not_receive(:to_ary)
459
459
 
460
460
  # @y.s(obj) { |(a, b), c| [a, b, c] }.should == [1, nil, 2]
461
461
  end
462
462
 
463
- pending "does not call #to_ary if the object does not respond to #to_ary" do
463
+ it "does not call #to_ary if the object does not respond to #to_ary" do
464
464
  obj = mock("block yield no to_ary")
465
465
 
466
466
  # @y.s(obj) { |(a, b), c| [a, b, c] }.should == [obj, nil, nil]
467
467
  end
468
468
 
469
- pending "raises an TypeError if #to_ary does not return an Array" do
469
+ it "raises an TypeError if #to_ary does not return an Array" do
470
470
  obj = mock("block yield to_ary invalid")
471
471
  obj.should_receive(:to_ary).and_return(1)
472
472
 
@@ -475,37 +475,37 @@ describe "A block" do
475
475
  end
476
476
 
477
477
  describe "taking nested |a, (b, (c, d))|" do
478
- pending "assigns nil to the arguments when yielded no values" do
478
+ it "assigns nil to the arguments when yielded no values" do
479
479
  # @y.m { |a, (b, (c, d))| [a, b, c, d] }.should == [nil, nil, nil, nil]
480
480
  end
481
481
 
482
- pending "destructures separate yielded values" do
482
+ it "destructures separate yielded values" do
483
483
  # @y.m(1, 2) { |a, (b, (c, d))| [a, b, c, d] }.should == [1, 2, nil, nil]
484
484
  end
485
485
 
486
- pending "destructures a single multi-level Array value yielded" do
486
+ it "destructures a single multi-level Array value yielded" do
487
487
  # @y.m(1, [2, 3]) { |a, (b, (c, d))| [a, b, c, d] }.should == [1, 2, 3, nil]
488
488
  end
489
489
 
490
- pending "destructures a single multi-level Array value yielded" do
490
+ it "destructures a single multi-level Array value yielded" do
491
491
  # @y.m(1, [2, [3, 4]]) { |a, (b, (c, d))| [a, b, c, d] }.should == [1, 2, 3, 4]
492
492
  end
493
493
  end
494
494
 
495
495
  describe "taking nested |a, ((b, c), d)|" do
496
- pending "assigns nil to the arguments when yielded no values" do
496
+ it "assigns nil to the arguments when yielded no values" do
497
497
  # @y.m { |a, ((b, c), d)| [a, b, c, d] }.should == [nil, nil, nil, nil]
498
498
  end
499
499
 
500
- pending "destructures separate yielded values" do
500
+ it "destructures separate yielded values" do
501
501
  # @y.m(1, 2) { |a, ((b, c), d)| [a, b, c, d] }.should == [1, 2, nil, nil]
502
502
  end
503
503
 
504
- pending "destructures a single multi-level Array value yielded" do
504
+ it "destructures a single multi-level Array value yielded" do
505
505
  # @y.m(1, [2, 3]) { |a, ((b, c), d)| [a, b, c, d] }.should == [1, 2, nil, 3]
506
506
  end
507
507
 
508
- pending "destructures a single multi-level Array value yielded" do
508
+ it "destructures a single multi-level Array value yielded" do
509
509
  # @y.m(1, [[2, 3], 4]) { |a, ((b, c), d)| [a, b, c, d] }.should == [1, 2, 3, 4]
510
510
  end
511
511
  end
@@ -523,11 +523,11 @@ describe "A block" do
523
523
  end
524
524
 
525
525
  ruby_version_is "1.9" do
526
- pending "extracts arguments with _" do
526
+ it "extracts arguments with _" do
527
527
  # @y.m([[1, 2, 3], 4]) { |(_, a, _), _| a }.should == 2
528
528
  end
529
529
 
530
- pending "assigns the first variable named" do
530
+ it "assigns the first variable named" do
531
531
  # @y.m(1, 2) { |_, _| _ }.should == 1
532
532
  end
533
533
  end