opal 1.6.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +17 -0
  3. data/CHANGELOG.md +35 -1
  4. data/Gemfile +1 -0
  5. data/HACKING.md +47 -26
  6. data/benchmark/benchmarks +415 -103
  7. data/benchmark/bm_call_overhead.yml +28 -0
  8. data/benchmark/run.rb +61 -40
  9. data/docs/cdp_common.json +3364 -0
  10. data/docs/cdp_common.md +18 -0
  11. data/docs/{headless_chrome.md → headless_browsers.md} +31 -12
  12. data/lib/opal/ast/builder.rb +1 -1
  13. data/lib/opal/builder.rb +6 -1
  14. data/lib/opal/builder_processors.rb +5 -3
  15. data/lib/opal/cache.rb +1 -7
  16. data/lib/opal/cli_options.rb +72 -58
  17. data/lib/opal/cli_runners/chrome.rb +47 -9
  18. data/lib/opal/cli_runners/chrome_cdp_interface.rb +238 -112
  19. data/lib/opal/cli_runners/compiler.rb +146 -13
  20. data/lib/opal/cli_runners/deno.rb +32 -0
  21. data/lib/opal/cli_runners/firefox.rb +350 -0
  22. data/lib/opal/cli_runners/firefox_cdp_interface.rb +212 -0
  23. data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.cmd +17 -0
  24. data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.ps1 +28 -0
  25. data/lib/opal/cli_runners/node_modules/.package-lock.json +41 -0
  26. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/LICENSE +1 -1
  27. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/README.md +322 -182
  28. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/bin/client.js +99 -114
  29. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/chrome-remote-interface.js +1 -11
  30. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js +16 -11
  31. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/api.js +41 -33
  32. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/chrome.js +224 -214
  33. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/devtools.js +71 -191
  34. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js +26 -6
  35. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/protocol.json +20788 -9049
  36. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/websocket-wrapper.js +10 -3
  37. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/package.json +59 -123
  38. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/webpack.config.js +25 -32
  39. data/lib/opal/cli_runners/node_modules/commander/History.md +298 -0
  40. data/lib/opal/cli_runners/node_modules/commander/LICENSE +22 -0
  41. data/lib/opal/cli_runners/node_modules/commander/Readme.md +217 -61
  42. data/lib/opal/cli_runners/node_modules/commander/index.js +431 -145
  43. data/lib/opal/cli_runners/node_modules/commander/package.json +16 -79
  44. data/lib/opal/cli_runners/node_modules/ws/README.md +334 -98
  45. data/lib/opal/cli_runners/node_modules/ws/browser.js +8 -0
  46. data/lib/opal/cli_runners/node_modules/ws/index.js +5 -10
  47. data/lib/opal/cli_runners/node_modules/ws/lib/buffer-util.js +129 -0
  48. data/lib/opal/cli_runners/node_modules/ws/lib/constants.js +10 -0
  49. data/lib/opal/cli_runners/node_modules/ws/lib/event-target.js +184 -0
  50. data/lib/opal/cli_runners/node_modules/ws/lib/extension.js +223 -0
  51. data/lib/opal/cli_runners/node_modules/ws/lib/limiter.js +55 -0
  52. data/lib/opal/cli_runners/node_modules/ws/lib/permessage-deflate.js +518 -0
  53. data/lib/opal/cli_runners/node_modules/ws/lib/receiver.js +607 -0
  54. data/lib/opal/cli_runners/node_modules/ws/lib/sender.js +409 -0
  55. data/lib/opal/cli_runners/node_modules/ws/lib/stream.js +180 -0
  56. data/lib/opal/cli_runners/node_modules/ws/lib/validation.js +104 -0
  57. data/lib/opal/cli_runners/node_modules/ws/lib/websocket-server.js +447 -0
  58. data/lib/opal/cli_runners/node_modules/ws/lib/websocket.js +1195 -0
  59. data/lib/opal/cli_runners/node_modules/ws/package.json +40 -106
  60. data/lib/opal/cli_runners/package-lock.json +62 -0
  61. data/lib/opal/cli_runners/package.json +1 -1
  62. data/lib/opal/cli_runners.rb +26 -4
  63. data/lib/opal/nodes/args/prepare_post_args.rb +2 -2
  64. data/lib/opal/nodes/def.rb +8 -8
  65. data/lib/opal/nodes/iter.rb +12 -12
  66. data/lib/opal/nodes/logic.rb +1 -1
  67. data/lib/opal/nodes/masgn.rb +2 -2
  68. data/lib/opal/parser/with_ruby_lexer.rb +1 -1
  69. data/lib/opal/paths.rb +14 -0
  70. data/lib/opal/rewriter.rb +2 -0
  71. data/lib/opal/rewriters/forward_args.rb +52 -4
  72. data/lib/opal/rewriters/targeted_patches.rb +94 -0
  73. data/lib/opal/version.rb +1 -1
  74. data/opal/corelib/basic_object.rb +1 -1
  75. data/opal/corelib/boolean.rb +2 -2
  76. data/opal/corelib/class.rb +11 -0
  77. data/opal/corelib/constants.rb +3 -3
  78. data/opal/corelib/enumerable.rb +4 -0
  79. data/opal/corelib/enumerator.rb +1 -1
  80. data/opal/corelib/hash.rb +2 -2
  81. data/opal/corelib/helpers.rb +1 -1
  82. data/opal/corelib/kernel.rb +3 -3
  83. data/opal/corelib/method.rb +1 -1
  84. data/opal/corelib/module.rb +29 -8
  85. data/opal/corelib/proc.rb +7 -5
  86. data/opal/corelib/runtime.js +141 -78
  87. data/opal/corelib/set.rb +252 -0
  88. data/opal/corelib/string.rb +2 -1
  89. data/opal/corelib/time.rb +2 -2
  90. data/opal/opal.rb +1 -0
  91. data/opal.gemspec +1 -0
  92. data/spec/filters/bugs/array.rb +22 -13
  93. data/spec/filters/bugs/base64.rb +5 -5
  94. data/spec/filters/bugs/basicobject.rb +16 -8
  95. data/spec/filters/bugs/bigdecimal.rb +161 -160
  96. data/spec/filters/bugs/binding.rb +10 -10
  97. data/spec/filters/bugs/class.rb +8 -8
  98. data/spec/filters/bugs/complex.rb +2 -1
  99. data/spec/filters/bugs/date.rb +79 -81
  100. data/spec/filters/bugs/datetime.rb +29 -29
  101. data/spec/filters/bugs/delegate.rb +1 -3
  102. data/spec/filters/bugs/encoding.rb +69 -69
  103. data/spec/filters/bugs/enumerable.rb +22 -20
  104. data/spec/filters/bugs/enumerator.rb +88 -85
  105. data/spec/filters/bugs/exception.rb +46 -40
  106. data/spec/filters/bugs/file.rb +32 -32
  107. data/spec/filters/bugs/float.rb +26 -21
  108. data/spec/filters/bugs/freeze.rb +88 -0
  109. data/spec/filters/bugs/hash.rb +39 -38
  110. data/spec/filters/bugs/integer.rb +57 -44
  111. data/spec/filters/bugs/io.rb +1 -1
  112. data/spec/filters/bugs/kernel.rb +349 -269
  113. data/spec/filters/bugs/language.rb +220 -188
  114. data/spec/filters/bugs/main.rb +5 -3
  115. data/spec/filters/bugs/marshal.rb +38 -38
  116. data/spec/filters/bugs/math.rb +2 -1
  117. data/spec/filters/bugs/method.rb +73 -62
  118. data/spec/filters/bugs/module.rb +163 -143
  119. data/spec/filters/bugs/numeric.rb +6 -6
  120. data/spec/filters/bugs/objectspace.rb +16 -16
  121. data/spec/filters/bugs/openstruct.rb +1 -1
  122. data/spec/filters/bugs/pack_unpack.rb +51 -51
  123. data/spec/filters/bugs/pathname.rb +7 -7
  124. data/spec/filters/bugs/proc.rb +63 -63
  125. data/spec/filters/bugs/random.rb +7 -6
  126. data/spec/filters/bugs/range.rb +12 -9
  127. data/spec/filters/bugs/rational.rb +8 -7
  128. data/spec/filters/bugs/regexp.rb +49 -48
  129. data/spec/filters/bugs/ruby-32.rb +56 -0
  130. data/spec/filters/bugs/set.rb +30 -30
  131. data/spec/filters/bugs/singleton.rb +4 -4
  132. data/spec/filters/bugs/string.rb +187 -99
  133. data/spec/filters/bugs/stringio.rb +7 -0
  134. data/spec/filters/bugs/stringscanner.rb +68 -68
  135. data/spec/filters/bugs/struct.rb +11 -9
  136. data/spec/filters/bugs/symbol.rb +1 -1
  137. data/spec/filters/bugs/time.rb +78 -63
  138. data/spec/filters/bugs/trace_point.rb +4 -4
  139. data/spec/filters/bugs/unboundmethod.rb +32 -17
  140. data/spec/filters/bugs/warnings.rb +8 -12
  141. data/spec/filters/unsupported/array.rb +24 -107
  142. data/spec/filters/unsupported/basicobject.rb +12 -12
  143. data/spec/filters/unsupported/bignum.rb +27 -52
  144. data/spec/filters/unsupported/class.rb +1 -2
  145. data/spec/filters/unsupported/delegator.rb +3 -3
  146. data/spec/filters/unsupported/enumerable.rb +2 -9
  147. data/spec/filters/unsupported/enumerator.rb +2 -11
  148. data/spec/filters/unsupported/file.rb +1 -1
  149. data/spec/filters/unsupported/float.rb +28 -47
  150. data/spec/filters/unsupported/hash.rb +8 -14
  151. data/spec/filters/unsupported/integer.rb +75 -91
  152. data/spec/filters/unsupported/kernel.rb +17 -35
  153. data/spec/filters/unsupported/language.rb +11 -19
  154. data/spec/filters/unsupported/marshal.rb +22 -41
  155. data/spec/filters/unsupported/matchdata.rb +28 -52
  156. data/spec/filters/unsupported/math.rb +1 -1
  157. data/spec/filters/unsupported/privacy.rb +229 -285
  158. data/spec/filters/unsupported/range.rb +1 -5
  159. data/spec/filters/unsupported/regexp.rb +40 -66
  160. data/spec/filters/unsupported/set.rb +2 -2
  161. data/spec/filters/unsupported/singleton.rb +4 -4
  162. data/spec/filters/unsupported/string.rb +305 -508
  163. data/spec/filters/unsupported/struct.rb +3 -4
  164. data/spec/filters/unsupported/symbol.rb +15 -18
  165. data/spec/filters/unsupported/thread.rb +1 -7
  166. data/spec/filters/unsupported/time.rb +159 -202
  167. data/spec/filters/unsupported/usage_of_files.rb +170 -259
  168. data/spec/lib/builder_spec.rb +4 -4
  169. data/spec/lib/rewriters/forward_args_spec.rb +32 -12
  170. data/spec/mspec-opal/runner.rb +2 -0
  171. data/spec/ruby_specs +4 -0
  172. data/stdlib/deno/base.rb +28 -0
  173. data/stdlib/deno/file.rb +340 -0
  174. data/stdlib/{headless_chrome.rb → headless_browser/base.rb} +1 -1
  175. data/stdlib/headless_browser/file.rb +15 -0
  176. data/stdlib/headless_browser.rb +4 -0
  177. data/stdlib/native.rb +1 -1
  178. data/stdlib/nodejs/file.rb +5 -0
  179. data/stdlib/opal/platform.rb +8 -6
  180. data/stdlib/opal-platform.rb +14 -8
  181. data/stdlib/set.rb +1 -258
  182. data/tasks/benchmarking.rake +62 -19
  183. data/tasks/performance.rake +1 -1
  184. data/tasks/testing.rake +5 -3
  185. data/test/nodejs/test_file.rb +29 -10
  186. data/test/opal/http_server.rb +28 -11
  187. data/test/opal/unsupported_and_bugs.rb +2 -1
  188. metadata +89 -50
  189. data/lib/opal/cli_runners/node_modules/ultron/LICENSE +0 -22
  190. data/lib/opal/cli_runners/node_modules/ultron/index.js +0 -138
  191. data/lib/opal/cli_runners/node_modules/ultron/package.json +0 -112
  192. data/lib/opal/cli_runners/node_modules/ws/SECURITY.md +0 -33
  193. data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.fallback.js +0 -56
  194. data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.js +0 -15
  195. data/lib/opal/cli_runners/node_modules/ws/lib/ErrorCodes.js +0 -28
  196. data/lib/opal/cli_runners/node_modules/ws/lib/EventTarget.js +0 -158
  197. data/lib/opal/cli_runners/node_modules/ws/lib/Extensions.js +0 -69
  198. data/lib/opal/cli_runners/node_modules/ws/lib/PerMessageDeflate.js +0 -339
  199. data/lib/opal/cli_runners/node_modules/ws/lib/Receiver.js +0 -520
  200. data/lib/opal/cli_runners/node_modules/ws/lib/Sender.js +0 -438
  201. data/lib/opal/cli_runners/node_modules/ws/lib/Validation.fallback.js +0 -9
  202. data/lib/opal/cli_runners/node_modules/ws/lib/Validation.js +0 -17
  203. data/lib/opal/cli_runners/node_modules/ws/lib/WebSocket.js +0 -705
  204. data/lib/opal/cli_runners/node_modules/ws/lib/WebSocketServer.js +0 -336
  205. data/spec/filters/bugs/boolean.rb +0 -3
  206. data/spec/filters/bugs/matrix.rb +0 -3
  207. data/spec/filters/unsupported/fixnum.rb +0 -15
  208. data/spec/filters/unsupported/freeze.rb +0 -102
  209. data/spec/filters/unsupported/pathname.rb +0 -4
  210. data/spec/filters/unsupported/proc.rb +0 -4
  211. data/spec/filters/unsupported/random.rb +0 -5
  212. data/spec/filters/unsupported/taint.rb +0 -162
@@ -1,189 +1,209 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Module" do
3
- fails "Module#alias_method creates methods that are == to each other" # Expected #<Method: #<Class:0x9122>#uno (defined in #<Class:0x9122> in ruby/core/module/fixtures/classes.rb:206)> == #<Method: #<Class:0x9122>#public_one (defined in ModuleSpecs::Aliasing in ruby/core/module/fixtures/classes.rb:206)> to be truthy but was false
4
- fails "Module#alias_method handles aliasing a method only present in a refinement" # NoMethodError: undefined method `refine' for #<Module:0x90fa>
5
- fails "Module#alias_method retains method visibility"
6
- fails "Module#alias_method returned value returns symbol of the defined method name" # Expected #<Class:0x1c94a> to be identical to "checking_return_value"
7
- fails "Module#ancestors returns a list of modules included in self (including self)" # Expected [ModuleSpecs::Parent, Object, Shellwords, Kernel, BasicObject] == [ModuleSpecs::Parent, Object, Kernel, BasicObject] to be truthy but was false -- a random failure
8
- fails "Module#append_features on Class raises a TypeError if calling after rebinded to Class"
9
- fails "Module#attr applies current visibility to methods created"
3
+ fails "Module#alias_method creates methods that are == to each other" # Expected #<Method: #<Class:0x3c38e>#uno (defined in #<Class:0x3c38e> in ruby/core/module/fixtures/classes.rb:214)> == #<Method: #<Class:0x3c38e>#public_one (defined in ModuleSpecs::Aliasing in ruby/core/module/fixtures/classes.rb:214)> to be truthy but was false
4
+ fails "Module#alias_method handles aliasing a method only present in a refinement" # Expected #<UnboundMethod: #<Module:0x3c30c>#uno_refined_method (defined in #<Module:0x3c30c> in ruby/core/module/alias_method_spec.rb:49)> == #<UnboundMethod: #<Module:0x3c30c>#double_refined_method (defined in #<Module:0x3c30c> in ruby/core/module/alias_method_spec.rb:49)> to be truthy but was false
5
+ fails "Module#alias_method retains method visibility" # Expected NameError but no exception was raised (1 was returned)
6
+ fails "Module#alias_method returned value returns symbol of the defined method name" # Expected #<Class:0x3c3d6> to be identical to "checking_return_value"
7
+ fails "Module#append_features on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (#<Class:0x3a2da> was returned)
8
+ fails "Module#attr applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned)
10
9
  fails "Module#attr converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
11
- fails "Module#attr raises a TypeError when the given names can't be converted to strings using to_str"
10
+ fails "Module#attr raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3a44c> was returned)
12
11
  fails "Module#attr returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false
13
- fails "Module#attr_accessor applies current visibility to methods created"
12
+ fails "Module#attr_accessor applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned)
14
13
  fails "Module#attr_accessor converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
15
- fails "Module#attr_accessor not allows creating an attr_accessor on an immediate class"
14
+ fails "Module#attr_accessor not allows creating an attr_accessor on an immediate class" # Expected FrozenError but got: Exception (Cannot create property 'spec_attr_accessor' on boolean 'true')
16
15
  fails "Module#attr_accessor on immediates can read through the accessor" # NoMethodError: undefined method `foobar' for 1
17
- fails "Module#attr_accessor raises a TypeError when the given names can't be converted to strings using to_str"
16
+ fails "Module#attr_accessor raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3a710> was returned)
18
17
  fails "Module#attr_accessor returns an array of defined method names as symbols" # Expected nil == ["foo", "foo=", "bar", "bar="] to be truthy but was false
19
- fails "Module#attr_reader applies current visibility to methods created"
18
+ fails "Module#attr_reader applies current visibility to methods created" # Expected NoMethodError but no exception was raised (nil was returned)
20
19
  fails "Module#attr_reader converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
21
- fails "Module#attr_reader not allows for adding an attr_reader to an immediate"
22
- fails "Module#attr_reader raises a TypeError when the given names can't be converted to strings using to_str"
20
+ fails "Module#attr_reader not allows for adding an attr_reader to an immediate" # Expected RuntimeError but got: Exception (Cannot create property 'spec_attr_reader' on boolean 'true')
21
+ fails "Module#attr_reader raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x3ba86> was returned)
23
22
  fails "Module#attr_reader returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false
24
- fails "Module#attr_writer applies current visibility to methods created"
23
+ fails "Module#attr_writer applies current visibility to methods created" # Expected NoMethodError but no exception was raised (1 was returned)
25
24
  fails "Module#attr_writer converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
26
- fails "Module#attr_writer not allows for adding an attr_writer to an immediate"
27
- fails "Module#attr_writer raises a TypeError when the given names can't be converted to strings using to_str"
25
+ fails "Module#attr_writer not allows for adding an attr_writer to an immediate" # Expected FrozenError but got: Exception (Cannot create property 'spec_attr_writer' on boolean 'true')
26
+ fails "Module#attr_writer raises a TypeError when the given names can't be converted to strings using to_str" # Expected TypeError but no exception was raised (#<Class:0x23050> was returned)
28
27
  fails "Module#attr_writer returns an array of defined method names as symbols" # Expected nil == ["foo=", "bar="] to be truthy but was false
29
- fails "Module#class_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x4a168>
30
- fails "Module#class_eval converts a non-string filename to a string using to_str"
31
- fails "Module#class_eval converts non string eval-string to string using to_str"
32
- fails "Module#class_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
33
- fails "Module#class_eval raises a TypeError when the given filename can't be converted to string using to_str"
34
- fails "Module#class_eval resolves constants in the caller scope ignoring send"
35
- fails "Module#class_eval resolves constants in the caller scope" # fails because of the difference between module_eval("Const") and module_eval { Const } (only the second one is supported by Opal)
36
- fails "Module#class_eval uses the optional filename and lineno parameters for error messages"
28
+ fails "Module#class_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x5db0a>
29
+ fails "Module#class_eval converts a non-string filename to a string using to_str" # Mock 'ruby/core/module/shared/class_eval.rb' expected to receive to_str("any_args") exactly 1 times but received it 0 times
30
+ fails "Module#class_eval converts non string eval-string to string using to_str" # Mock '1 + 1' expected to receive to_str("any_args") exactly 1 times but received it 0 times
31
+ fails "Module#class_eval raises a TypeError when the given eval-string can't be converted to string using to_str" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `encoding' for #<MockObject:0x5d8a0 @name="x" @null=nil>)
32
+ fails "Module#class_eval raises a TypeError when the given filename can't be converted to string using to_str" # Expected TypeError (/can't convert MockObject to String/) but no exception was raised (2 was returned)
33
+ fails "Module#class_eval raises an ArgumentError when a block and normal arguments are given" # Expected ArgumentError (wrong number of arguments (given 1, expected 0)) but got: ArgumentError (wrong number of arguments (1 for 0) NOTE:If you want to enable passing a String argument please add "require 'opal-parser'" to your script )
34
+ fails "Module#class_eval raises an ArgumentError when more than 3 arguments are given" # Expected ArgumentError (wrong number of arguments (given 4, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3))
35
+ fails "Module#class_eval raises an ArgumentError when no arguments and no block are given" # Expected ArgumentError (wrong number of arguments (given 0, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3))
36
+ fails "Module#class_eval resolves constants in the caller scope ignoring send" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup
37
+ fails "Module#class_eval resolves constants in the caller scope" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup
38
+ fails "Module#class_eval uses the optional filename and lineno parameters for error messages" # Expected ["test", 1] == ["test", 102] to be truthy but was false
39
+ fails "Module#class_variables returns the correct class variables when inherit is given" # ArgumentError: [SubCVars.class_variables] wrong number of arguments (given 1, expected 0)
37
40
  fails "Module#const_defined? coerces the inherit flag to a boolean" # Expected true to be false
38
- fails "Module#const_defined? returns true for toplevel constant when the name begins with '::'"
39
- fails "Module#const_defined? returns true or false for the nested name"
40
- fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is default"
41
- fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is true"
42
- fails "Module#const_defined? returns true when passed a scoped constant name"
41
+ fails "Module#const_defined? returns true for toplevel constant when the name begins with '::'" # Expected false to be true
42
+ fails "Module#const_defined? returns true or false for the nested name" # Expected false == true to be truthy but was false
43
+ fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is default" # Expected false to be true
44
+ fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is true" # Expected false to be true
45
+ fails "Module#const_defined? returns true when passed a scoped constant name" # Expected false to be true
46
+ fails "Module#const_get accepts a toplevel scope qualifier when inherit is false" # NameError: uninitialized constant ConstantSpecs::CS_CONST1
43
47
  fails "Module#const_get coerces the inherit flag to a boolean" # Expected NameError but no exception was raised ("const1" was returned)
48
+ fails "Module#const_get raises a NameError when the nested constant does not exist on the module but exists in Object" # Expected NameError but no exception was raised ("const1" was returned)
44
49
  fails "Module#const_set sets the name of a module scoped by an anonymous module" # NoMethodError: undefined method `end_with?' for nil
45
50
  fails "Module#const_set when overwriting an existing constant does not warn after a failed autoload" # Expected NameError but got: LoadError (cannot load such file -- ruby/core/module/fixtures/autoload_o)
46
51
  fails "Module#const_set when overwriting an existing constant warns if the previous value was a normal value" # Expected warning to match: /already initialized constant/ but got: ""
47
- fails "Module#const_source_location accepts a String or Symbol name" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
48
- fails "Module#const_source_location accepts a scoped constant name" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
49
- fails "Module#const_source_location accepts a toplevel scope qualifier" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
50
- fails "Module#const_source_location autoload returns the autoload location while not resolved" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
51
- fails "Module#const_source_location autoload returns where the constant was resolved when resolved" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
52
- fails "Module#const_source_location calls #to_str to convert the given name to a String" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
53
- fails "Module#const_source_location does not search the containing scope" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
54
- fails "Module#const_source_location does not search the singleton class of a Class or Module" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
55
- fails "Module#const_source_location does search private constants path" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
56
- fails "Module#const_source_location raises a NameError if the name contains non-alphabetic characters except '_'" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
57
- fails "Module#const_source_location raises a TypeError if conversion to a String by calling #to_str fails" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
58
- fails "Module#const_source_location return empty path if constant defined in C code" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
59
- fails "Module#const_source_location returns nil if no constant is defined in the search path" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
60
- fails "Module#const_source_location returns nil if the constant is defined in the receiver's superclass and the inherit flag is false" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
61
- fails "Module#const_source_location returns nil when the receiver is a Class, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
62
- fails "Module#const_source_location returns nil when the receiver is a Module, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
63
- fails "Module#const_source_location searches into the receiver superclasses if the inherit flag is true" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
64
- fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
65
- fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
66
- fails "Module#const_source_location with dynamically assigned constants returns path to the updated value of a constant" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
67
- fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the immediate class before the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
68
- fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
69
- fails "Module#const_source_location with dynamically assigned constants searches a path in the immediate class or module first" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
70
- fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass before a module included in the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
71
- fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass chain" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
72
- fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
73
- fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
74
- fails "Module#const_source_location with statically assigned constants searches location path a module included in the immediate class before the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
75
- fails "Module#const_source_location with statically assigned constants searches location path a module included in the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
76
- fails "Module#const_source_location with statically assigned constants searches location path the immediate class or module first" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
77
- fails "Module#const_source_location with statically assigned constants searches location path the superclass before a module included in the superclass" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
78
- fails "Module#const_source_location with statically assigned constants searches location path the superclass chain" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
79
- fails "Module#constants doesn't returns inherited constants when passed nil"
80
- fails "Module#constants returns only public constants"
52
+ fails "Module#const_source_location accepts a String or Symbol name" # NoMethodError: undefined method `const_source_location' for Object
53
+ fails "Module#const_source_location accepts a scoped constant name" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
54
+ fails "Module#const_source_location accepts a toplevel scope qualifier" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
55
+ fails "Module#const_source_location autoload returns the autoload location while not resolved" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
56
+ fails "Module#const_source_location autoload returns where the constant was resolved when resolved" # LoadError: cannot load such file -- ruby/core/module/fixtures/autoload_location
57
+ fails "Module#const_source_location calls #to_str to convert the given name to a String" # Mock 'ClassA' expected to receive to_str("any_args") exactly 1 times but received it 0 times
58
+ fails "Module#const_source_location does not search the containing scope" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
59
+ fails "Module#const_source_location does not search the singleton class of a Class or Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
60
+ fails "Module#const_source_location does search private constants path" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
61
+ fails "Module#const_source_location raises a NameError if the name contains non-alphabetic characters except '_'" # NoMethodError: undefined method `const_source_location' for Object
62
+ fails "Module#const_source_location raises a TypeError if conversion to a String by calling #to_str fails" # Expected TypeError but got: NoMethodError (undefined method `const_source_location' for ConstantSpecs)
63
+ fails "Module#const_source_location return empty path if constant defined in C code" # NoMethodError: undefined method `const_source_location' for Object
64
+ fails "Module#const_source_location returns nil if no constant is defined in the search path" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
65
+ fails "Module#const_source_location returns nil if the constant is defined in the receiver's superclass and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
66
+ fails "Module#const_source_location returns nil when the receiver is a Class, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
67
+ fails "Module#const_source_location returns nil when the receiver is a Module, the constant is defined at toplevel and the inherit flag is false" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ModuleA
68
+ fails "Module#const_source_location returns updated location from const_set" # NoMethodError: undefined method `const_source_location' for #<Module:0x38290>
69
+ fails "Module#const_source_location searches into the receiver superclasses if the inherit flag is true" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
70
+ fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB
71
+ fails "Module#const_source_location with dynamically assigned constants returns path to a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
72
+ fails "Module#const_source_location with dynamically assigned constants returns path to the updated value of a constant" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassB
73
+ fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the immediate class before the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB
74
+ fails "Module#const_source_location with dynamically assigned constants searches a path in a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB
75
+ fails "Module#const_source_location with dynamically assigned constants searches a path in the immediate class or module first" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassA
76
+ fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass before a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB
77
+ fails "Module#const_source_location with dynamically assigned constants searches a path in the superclass chain" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerB::ChildB
78
+ fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Class" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
79
+ fails "Module#const_source_location with statically assigned constants returns location path a toplevel constant when the receiver is a Module" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
80
+ fails "Module#const_source_location with statically assigned constants searches location path a module included in the immediate class before the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
81
+ fails "Module#const_source_location with statically assigned constants searches location path a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
82
+ fails "Module#const_source_location with statically assigned constants searches location path the immediate class or module first" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassA
83
+ fails "Module#const_source_location with statically assigned constants searches location path the superclass before a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
84
+ fails "Module#const_source_location with statically assigned constants searches location path the superclass chain" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
85
+ fails "Module#constants doesn't returns inherited constants when passed nil" # Expected ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST24", "CS_CONST5", "ChildA"] == ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST5", "ChildA"] to be truthy but was false
86
+ fails "Module#constants returns only public constants" # Expected ["PRIVATE_CONSTANT", "PUBLIC_CONSTANT"] == ["PUBLIC_CONSTANT"] to be truthy but was false
87
+ fails "Module#define_method converts non-String name to String with #to_str" # NoMethodError: undefined method `foo' for #<#<Class:0x33ce6>:0x33ce4>
81
88
  fails "Module#define_method passed { |a,| } creates a method that does not destructure the passed argument" # Expected [1, 2] == 1 to be truthy but was false
82
- fails "Module#define_method raises a TypeError when a Method from a singleton class is defined on another class"
83
- fails "Module#define_method raises a TypeError when a Method from one class is defined on an unrelated class"
84
- fails "Module#define_method raises a TypeError when an UnboundMethod from a child class is defined on a parent class"
85
- fails "Module#define_method raises a TypeError when an UnboundMethod from a singleton class is defined on another class" # Expected TypeError (/can't bind singleton method to a different class/) but no exception was raised (#<Class:0x47ae6> was returned)
86
- fails "Module#define_method raises a TypeError when an UnboundMethod from one class is defined on an unrelated class"
87
- fails "Module#deprecate_constant accepts multiple symbols and strings as constant names"
88
- fails "Module#deprecate_constant raises a NameError when given an undefined name"
89
- fails "Module#deprecate_constant returns self"
90
- fails "Module#deprecate_constant when accessing the deprecated module does not warn if Warning[:deprecated] is false" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x133e6>
91
- fails "Module#deprecate_constant when accessing the deprecated module passes the accessing"
92
- fails "Module#deprecate_constant when accessing the deprecated module warns with a message"
93
- fails "Module#extend_object extends the given object with its constants and methods by default"
94
- fails "Module#extend_object on Class raises a TypeError if calling after rebinded to Class"
95
- fails "Module#include doesn't accept no-arguments" # Expected ArgumentError but no exception was raised (#<Module:0x4fbac> was returned)
89
+ fails "Module#define_method raises TypeError if name cannot converted to String" # Expected TypeError (/is not a symbol nor a string/) but no exception was raised (#<Class:0x33da2> was returned)
90
+ fails "Module#define_method raises TypeError when #to_str called on non-String name returns non-String value" # Expected TypeError (/can't convert Object to String/) but no exception was raised (#<Class:0x33d52> was returned)
91
+ fails "Module#define_method raises a TypeError when a Method from a singleton class is defined on another class" # Expected TypeError (/can't bind singleton method to a different class/) but no exception was raised (#<Class:0x33cdc> was returned)
92
+ fails "Module#define_method raises a TypeError when a Method from one class is defined on an unrelated class" # Expected TypeError but no exception was raised (#<Class:0x33d6c> was returned)
93
+ fails "Module#define_method raises a TypeError when an UnboundMethod from a child class is defined on a parent class" # Expected TypeError (/bind argument must be a subclass of ChildClass/) but no exception was raised ("foo" was returned)
94
+ fails "Module#define_method raises a TypeError when an UnboundMethod from a singleton class is defined on another class" # Expected TypeError (/can't bind singleton method to a different class/) but no exception was raised (#<Class:0x33cac> was returned)
95
+ fails "Module#define_method raises a TypeError when an UnboundMethod from one class is defined on an unrelated class" # Expected TypeError (/bind argument must be a subclass of ModuleSpecs::InstanceMeth/) but no exception was raised (DestinationClass was returned)
96
+ fails "Module#define_method raises a TypeError when the given method is no Method/Proc" # Expected TypeError (wrong argument type String (expected Proc/Method/UnboundMethod)) but got: TypeError (wrong argument type NilClass (expected Proc/Method))
97
+ fails "Module#define_method uses provided Method/Proc even if block is specified" # Expected "block_is_called" == "method_is_called" to be truthy but was false
98
+ fails "Module#deprecate_constant accepts multiple symbols and strings as constant names" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf08>
99
+ fails "Module#deprecate_constant raises a NameError when given an undefined name" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf04>
100
+ fails "Module#deprecate_constant returns self" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf0c>
101
+ fails "Module#deprecate_constant when accessing the deprecated module does not warn if Warning[:deprecated] is false" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf10>
102
+ fails "Module#deprecate_constant when accessing the deprecated module passes the accessing" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf18>
103
+ fails "Module#deprecate_constant when accessing the deprecated module warns with a message" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x3bf14>
104
+ fails "Module#extend_object extends the given object with its constants and methods by default" # NoMethodError: undefined method `test_method' for #<MockObject:0x2541a @name="extended direct" @null=nil>
105
+ fails "Module#extend_object on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (nil was returned)
106
+ fails "Module#include doesn't accept no-arguments" # Expected ArgumentError but no exception was raised (#<Module:0xdd44> was returned)
96
107
  fails "Module#initialize_copy should produce a duped module with inspectable class methods" # NameError: undefined method `hello' for class `Module'
97
- fails "Module#initialize_copy should retain singleton methods when duped" # Expected [] to equal ["hello"]
98
- fails "Module#instance_method raises a NameError if the method has been undefined"
99
- fails "Module#instance_method raises a TypeError if not passed a symbol"
100
- fails "Module#instance_method raises a TypeError if the given name is not a string/symbol"
101
- fails "Module#method_added is called with a precise caller location with the line of the 'def'" # NoMethodError: undefined method `caller_locations' for #<Module:0xaa8>
102
- fails "Module#method_defined? converts the given name to a string using to_str"
108
+ fails "Module#initialize_copy should retain singleton methods when duped" # Expected [] == ["hello"] to be truthy but was false
109
+ fails "Module#instance_method converts non-String name by calling #to_str method" # NameError: undefined method `#<Object:0x3a942>' for class `ModuleSpecs::InstanceMeth'
110
+ fails "Module#instance_method raises TypeError when passed non-String name and #to_str returns non-String value" # Expected TypeError (/can't convert Object to String/) but got: NameError (undefined method `#<Object:0x3a98e>' for class `ModuleSpecs::InstanceMeth')
111
+ fails "Module#instance_method raises a NameError if the method has been undefined" # Expected #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> == #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> to be truthy but was false
112
+ fails "Module#instance_method raises a TypeError if the given name is not a String/Symbol" # Expected TypeError (/is not a symbol nor a string/) but got: NameError (undefined method `' for class `Object')
113
+ fails "Module#method_added is called with a precise caller location with the line of the 'def'" # Expected [110, 110] == [74, 77] to be truthy but was false
114
+ fails "Module#method_defined? converts the given name to a string using to_str" # Expected false == true to be truthy but was false
103
115
  fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol" # Expected TypeError but no exception was raised (false was returned)
104
- fails "Module#method_defined? returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules"
105
- fails "Module#method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.method_defined?] wrong number of arguments(2 for 1)
106
- fails "Module#method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.method_defined?] wrong number of arguments(2 for 1)
107
- fails "Module#module_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x81f82>
108
- fails "Module#module_eval converts a non-string filename to a string using to_str"
109
- fails "Module#module_eval converts non string eval-string to string using to_str"
110
- fails "Module#module_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
111
- fails "Module#module_eval raises a TypeError when the given filename can't be converted to string using to_str"
112
- fails "Module#module_eval resolves constants in the caller scope ignoring send"
113
- fails "Module#module_eval resolves constants in the caller scope"
114
- fails "Module#module_eval uses the optional filename and lineno parameters for error messages"
115
- fails "Module#module_function as a toggle (no arguments) in a Module body does not affect module_evaled method definitions also if outside the eval itself"
116
- fails "Module#module_function as a toggle (no arguments) in a Module body doesn't affect definitions when inside an eval even if the definitions are outside of it"
117
- fails "Module#module_function as a toggle (no arguments) in a Module body has no effect if inside a module_eval if the definitions are outside of it"
118
- fails "Module#module_function on Class raises a TypeError if calling after rebinded to Class"
119
- fails "Module#module_function with specific method names raises a TypeError when the given names can't be converted to string using to_str"
120
- fails "Module#module_function with specific method names tries to convert the given names to strings using to_str"
121
- fails "Module#name changes when the module is reachable through a constant path" # Expected nil to match /^#<Module:0x\h+>::N$/
122
- fails "Module#name is not nil for a nested module created with the module keyword"
116
+ fails "Module#method_defined? returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules" # Expected true == false to be truthy but was false
117
+ fails "Module#method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.method_defined?] wrong number of arguments (given 2, expected 1)
118
+ fails "Module#method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.method_defined?] wrong number of arguments (given 2, expected 1)
119
+ fails "Module#module_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x34f0c>
120
+ fails "Module#module_eval converts a non-string filename to a string using to_str" # Mock 'ruby/core/module/shared/class_eval.rb' expected to receive to_str("any_args") exactly 1 times but received it 0 times
121
+ fails "Module#module_eval converts non string eval-string to string using to_str" # Mock '1 + 1' expected to receive to_str("any_args") exactly 1 times but received it 0 times
122
+ fails "Module#module_eval raises a TypeError when the given eval-string can't be converted to string using to_str" # Expected TypeError (no implicit conversion of MockObject into String) but got: NoMethodError (undefined method `encoding' for #<MockObject:0x34dc8 @name="x" @null=nil>)
123
+ fails "Module#module_eval raises a TypeError when the given filename can't be converted to string using to_str" # Expected TypeError (/can't convert MockObject to String/) but no exception was raised (2 was returned)
124
+ fails "Module#module_eval raises an ArgumentError when a block and normal arguments are given" # Expected ArgumentError (wrong number of arguments (given 1, expected 0)) but got: ArgumentError (wrong number of arguments (1 for 0) NOTE:If you want to enable passing a String argument please add "require 'opal-parser'" to your script )
125
+ fails "Module#module_eval raises an ArgumentError when more than 3 arguments are given" # Expected ArgumentError (wrong number of arguments (given 4, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3))
126
+ fails "Module#module_eval raises an ArgumentError when no arguments and no block are given" # Expected ArgumentError (wrong number of arguments (given 0, expected 1..3)) but got: ArgumentError (wrong number of arguments (0 for 1..3))
127
+ fails "Module#module_eval resolves constants in the caller scope ignoring send" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup
128
+ fails "Module#module_eval resolves constants in the caller scope" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup
129
+ fails "Module#module_eval uses the optional filename and lineno parameters for error messages" # Expected ["test", 1] == ["test", 102] to be truthy but was false
130
+ fails "Module#module_function as a toggle (no arguments) in a Module body does not affect module_evaled method definitions also if outside the eval itself" # Expected true == false to be truthy but was false
131
+ fails "Module#module_function as a toggle (no arguments) in a Module body doesn't affect definitions when inside an eval even if the definitions are outside of it" # Expected true == false to be truthy but was false
132
+ fails "Module#module_function as a toggle (no arguments) in a Module body has no effect if inside a module_eval if the definitions are outside of it" # Expected true == false to be truthy but was false
133
+ fails "Module#module_function on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (nil was returned)
134
+ fails "Module#module_function with specific method names raises a TypeError when the given names can't be converted to string using to_str" # Expected TypeError but got: Exception (Cannot set properties of undefined (setting 'displayName'))
135
+ fails "Module#module_function with specific method names tries to convert the given names to strings using to_str" # Exception: Cannot set properties of undefined (setting 'displayName')
136
+ fails "Module#name changes when the module is reachable through a constant path" # Expected nil =~ /^#<Module:0x\h+>::N$/ to be truthy but was false
137
+ fails "Module#name is not nil for a nested module created with the module keyword" # Expected nil =~ /^#<Module:0x[0-9a-f]+>::N$/ to be truthy but was false
123
138
  fails "Module#name is not nil when assigned to a constant in an anonymous module" # NoMethodError: undefined method `end_with?' for nil
124
- fails "Module#name is set after it is removed from a constant under an anonymous module" # Expected nil to match /^#<Module:0x\h+>::Child$/
125
- fails "Module#prepend keeps the module in the chain when dupping the class"
126
- fails "Module#prepend uses only new module when dupping the module" # Expected [#<Module:0x6c37a>] == [#<Module:0x6c38c>, #<Module:0x6c37a>] to be truthy but was false
127
- fails "Module#private with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x7b0e0> to have private instance method 'test1' but it does not
128
- fails "Module#private with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x2f186> to have private instance method 'test1' but it does not
139
+ fails "Module#name is set after it is removed from a constant under an anonymous module" # Expected nil =~ /^#<Module:0x\h+>::Child$/ to be truthy but was false
140
+ fails "Module#prepend keeps the module in the chain when dupping the class" # Exception: self.$$constructor is not a constructor
141
+ fails "Module#prepend uses only new module when dupping the module" # Expected [#<Module:0xa8270>] == [#<Module:0xa8282>, #<Module:0xa8270>] to be truthy but was false
142
+ fails "Module#private with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x3bf72> to have private instance method 'test1' but it does not
143
+ fails "Module#private with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x3bf6c> to have private instance method 'test1' but it does not
129
144
  fails "Module#private_class_method when single argument is passed and is an array sets the visibility of the given methods to private" # Expected NoMethodError but no exception was raised ("foo" was returned)
130
145
  fails "Module#private_constant marked constants in a module raises a NameError when accessed directly from modules that include the module" # Expected NameError but no exception was raised (true was returned)
131
146
  fails "Module#private_constant marked constants sends #const_missing to the original class or module" # Expected true == "Foo" to be truthy but was false
132
147
  fails "Module#private_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned)
133
- fails "Module#private_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments(2 for 1)
134
- fails "Module#private_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments(2 for 1)
135
- fails "Module#protected with argument array as a single argument sets visibility of given method names" # NoMethodError: undefined method `protected_instance_methods' for #<Module:0x6994a>
136
- fails "Module#protected with argument one or more arguments sets visibility of given method names" # NoMethodError: undefined method `protected_instance_methods' for #<Module:0x33d4a>
148
+ fails "Module#private_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1)
149
+ fails "Module#private_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1)
150
+ fails "Module#protected with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x59bb0> to have protected instance method 'test1' but it does not
151
+ fails "Module#protected with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x59baa> to have protected instance method 'test1' but it does not
137
152
  fails "Module#protected_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned)
138
- fails "Module#protected_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments(2 for 1)
139
- fails "Module#protected_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments(2 for 1)
153
+ fails "Module#protected_method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1)
154
+ fails "Module#protected_method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.private_method_defined?] wrong number of arguments (given 2, expected 1)
140
155
  fails "Module#public_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned)
141
156
  fails "Module#refine and alias aliases a method within a refinement module, but not outside it" # NameError: undefined method `count' for class `'
142
157
  fails "Module#refine and alias_method aliases a method within a refinement module, but not outside it" # NameError: undefined method `count' for class `'
143
- fails "Module#refine and instance_methods returns a list of methods including those of the refined module" # Expected ["to_json_format", "initialize", "&", "|", "*", "+", "-", "<<", "<=>", "==", "[]", "[]=", "any?", "assoc", "at", "bsearch_index", "bsearch", "cycle", "clear", "count", "initialize_copy", "collect", "collect!", "combination", "repeated_combination", "compact", "compact!", "concat", "delete", "delete_at", "delete_if", "difference", "dig", "drop", "dup", "each", "each_index", "empty?", "eql?", "fetch", "fill", "first", "flatten", "flatten!", "hash", "include?", "index", "insert", "inspect", "intersection", "join", "keep_if", "last", "length", "map", "map!", "max", "min", "permutation", "repeated_permutation", "pop", "product", "push", "append", "rassoc", "reject", "reject!", "replace", "reverse", "reverse!", "reverse_each", "rindex", "rotate", "rotate!", "sample", "select", "select!", "filter", "filter!", "shift", "size", "shuffle", "shuffle!", "slice", "slice!", "sort", "sort!", "sort_by!", "take", "take_while", "to_a", "to_ary", "to_h", "to_s", "transpose", "union", "uniq", "uniq!", "unshift", "prepend", "values_at", "zip", "instance_variables", "pack", "pretty_print", "pretty_print_cycle", "__marshal__", "deconstruct", "all?", "chunk", "chunk_while", "collect_concat", "detect", "drop_while", "each_cons", "each_entry", "each_slice", "each_with_index", "each_with_object", "entries", "filter_map", "find", "find_all", "find_index", "flat_map", "grep", "grep_v", "group_by", "inject", "lazy", "enumerator_size", "max_by", "member?", "min_by", "minmax", "minmax_by", "none?", "one?", "partition", "reduce", "slice_before", "slice_after", "slice_when", "sort_by", "sum", "tally", "to_set", "require", "using", "guard", "guard_not", "with_feature", "without_feature", "new_fd", "new_io", "should", "should_not", "version_is", "ruby_version_is", "suppress_warning", "suppress_keyword_warning", "should_receive", "should_not_receive", "stub!", "mock", "mock_int", "mock_numeric", "evaluate", "before", "after", "describe", "it", "it_should_behave_like", "context", "specify", "it_behaves_like", "ruby_bug", "conflicts_with", "big_endian", "little_endian", "platform_is", "platform_is_not", "quarantine!", "not_supported_on", "as_superuser", "as_user", "argf", "argv", "new_datetime", "with_timezone", "fixture", "flunk", "cp", "mkdir_p", "rm_r", "touch", "mock_to_path", "nan_value", "infinity_value", "bignum_value", "max_long", "min_long", "fixnum_max", "fixnum_min", "ruby_exe_options", "resolve_ruby_exe", "ruby_exe", "ruby_cmd", "opal_filter", "opal_unsupported_filter", "frozen_error_class", "pack_format", "module_specs_public_method_on_object", "module_specs_private_method_on_object", "module_specs_protected_method_on_object", "module_specs_private_method_on_object_for_kernel_public", "module_specs_public_method_on_object_for_kernel_protected", "module_specs_public_method_on_object_for_kernel_private", "unpack_format", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "check_autoload", "defined_specs_method", "defined_specs_receiver", "expect", "eq", "pretty_print_instance_variables", "pretty_print_inspect", "method_missing", "=~", "!~", "===", "method", "methods", "public_methods", "Array", "at_exit", "caller", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "initialize_clone", "define_singleton_method", "initialize_dup", "enum_for", "to_enum", "equal?", "exit", "extend", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "remove_instance_variable", "Integer", "Float", "Hash", "is_a?", "itself", "kind_of?", "lambda", "load", "loop", "nil?", "object_id", "printf", "proc", "puts", "p", "print", "warn", "raise", "fail", "rand", "respond_to?", "respond_to_missing?", "require_relative", "require_tree", "send", "public_send", "singleton_class", "sleep", "srand", "String", "tap", "to_proc", "catch", "throw", "open", "yield_self", "then", "format", "sprintf", "Complex", "Rational", "freeze", "frozen?", "taint", "untaint", "tainted?", "private_methods", "private_instance_methods", "eval", "node_require", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "binding", "BigDecimal", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel", "__send__", "!=", "__id__", "!", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined"] == [] to be truthy but was false
158
+ fails "Module#refine and instance_methods returns a list of methods including those of the refined module" # Expected ["initialize", "&", "|", "*", "+", "-", "<<", "<=>", "==", "[]", "[]=", "any?", "assoc", "at", "bsearch_index", "bsearch", "cycle", "clear", "count", "initialize_copy", "collect", "collect!", "combination", "repeated_combination", "compact", "compact!", "concat", "delete", "delete_at", "delete_if", "difference", "dig", "drop", "dup", "each", "each_index", "empty?", "eql?", "fetch", "fill", "first", "flatten", "flatten!", "freeze", "hash", "include?", "index", "insert", "inspect", "intersection", "intersect?", "join", "keep_if", "last", "length", "max", "min", "permutation", "repeated_permutation", "pop", "product", "push", "rassoc", "reject", "reject!", "replace", "reverse", "reverse!", "reverse_each", "rindex", "rotate", "rotate!", "sample", "select", "select!", "shift", "shuffle", "shuffle!", "slice!", "sort", "sort!", "sort_by!", "take", "take_while", "to_a", "to_ary", "to_h", "transpose", "union", "uniq", "uniq!", "unshift", "values_at", "zip", "instance_variables", "pack", "append", "filter", "filter!", "map", "map!", "prepend", "size", "slice", "to_s", "deconstruct", "to_json", "pretty_print", "pretty_print_cycle", "shelljoin", "__marshal__", "all?", "chunk", "chunk_while", "collect_concat", "detect", "drop_while", "each_cons", "each_entry", "each_slice", "each_with_index", "each_with_object", "entries", "filter_map", "find_all", "find_index", "grep", "grep_v", "group_by", "inject", "lazy", "enumerator_size", "max_by", "min_by", "minmax", "minmax_by", "none?", "one?", "partition", "slice_before", "slice_after", "slice_when", "sort_by", "sum", "tally", "find", "flat_map", "member?", "reduce", "to_set", "guard", "guard_not", "with_feature", "without_feature", "new_fd", "new_io", "should", "should_not", "version_is", "ruby_version_is", "kernel_version_is", "suppress_warning", "suppress_keyword_warning", "should_receive", "should_not_receive", "stub!", "mock", "mock_int", "mock_numeric", "evaluate", "before", "after", "describe", "it", "it_should_behave_like", "context", "specify", "it_behaves_like", "ruby_bug", "conflicts_with", "big_endian", "little_endian", "platform_is", "platform_is_not", "quarantine!", "not_supported_on", "as_superuser", "as_real_superuser", "as_user", "argf", "argv", "new_datetime", "with_timezone", "fixture", "flunk", "cp", "mkdir_p", "rm_r", "touch", "mock_to_path", "nan_value", "infinity_value", "bignum_value", "max_long", "min_long", "fixnum_max", "fixnum_min", "ruby_exe_options", "resolve_ruby_exe", "ruby_exe", "ruby_cmd", "opal_filter", "opal_unsupported_filter", "frozen_error_class", "pack_format", "module_specs_public_method_on_object", "module_specs_private_method_on_object", "module_specs_protected_method_on_object", "module_specs_private_method_on_object_for_kernel_public", "module_specs_public_method_on_object_for_kernel_protected", "module_specs_public_method_on_object_for_kernel_private", "unpack_format", "DelegateClass", "lang_send_rest_len", "main_public_method", "main_public_method2", "main_private_method", "main_private_method2", "defined_specs_method", "defined_specs_receiver", "example_instance_method_of_object", "toplevel_define_other_method", "some_toplevel_method", "public_toplevel_method", "check_autoload", "shellsplit", "shellwords", "shellescape", "expect", "eq", "pretty_print_instance_variables", "pretty_print_inspect", "=~", "!~", "===", "method", "methods", "public_methods", "Array", "at_exit", "caller", "caller_locations", "class", "copy_instance_variables", "copy_singleton_methods", "clone", "initialize_clone", "define_singleton_method", "initialize_dup", "enum_for", "equal?", "exit", "extend", "frozen?", "gets", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "remove_instance_variable", "Integer", "Float", "Hash", "is_a?", "itself", "lambda", "load", "loop", "nil?", "printf", "proc", "puts", "p", "print", "readline", "warn", "raise", "rand", "respond_to?", "respond_to_missing?", "require", "require_relative", "require_tree", "singleton_class", "sleep", "srand", "String", "tap", "to_proc", "catch", "throw", "open", "yield_self", "fail", "kind_of?", "object_id", "public_send", "send", "then", "to_enum", "format", "sprintf", "Complex", "Rational", "taint", "untaint", "tainted?", "private_methods", "protected_methods", "private_instance_methods", "protected_instance_methods", "eval", "binding", "Pathname", "require_remote", "pretty_inspect", "pp", "opal_parse", "eval_js", "module_specs_public_method_on_kernel", "module_specs_alias_on_kernel", "BigDecimal", "__send__", "__id__", "!", "!=", "instance_eval", "instance_exec", "singleton_method_added", "singleton_method_removed", "singleton_method_undefined", "method_missing"] == [] to be truthy but was false
144
159
  fails "Module#refine applies refinements to calls in the refine block" # NoMethodError: undefined method `foo' for "hello"
145
160
  fails "Module#refine does not override methods in subclasses" # Expected "foo from refinement" == "foo from subclass" to be truthy but was false
146
161
  fails "Module#refine for methods accessed indirectly is honored by BasicObject#__send__" # Expected "foo" == "foo from refinement" to be truthy but was false
147
- fails "Module#refine for methods accessed indirectly is honored by Kernel#public_method" # NoMethodError: undefined method `public_method' for #<#<Class:0x1b194>:0x1b196>
162
+ fails "Module#refine for methods accessed indirectly is honored by Kernel#public_method" # NoMethodError: undefined method `public_method' for #<#<Class:0x3d7c2>:0x3d7c6>
148
163
  fails "Module#refine for methods accessed indirectly is honored by Kernel#public_send" # Expected "foo" == "foo from refinement" to be truthy but was false
149
164
  fails "Module#refine for methods accessed indirectly is honored by Kernel#send" # Expected "foo" == "foo from refinement" to be truthy but was false
150
- fails "Module#refine for methods accessed indirectly is honored by Symbol#to_proc"
151
- fails "Module#refine for methods accessed indirectly is honored by string interpolation"
152
- fails "Module#refine makes available all refinements from the same module" # NoMethodError: undefined method `dump' for "1"
153
- fails "Module#refine method lookup looks in the included modules for builtin methods" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1aaee>
165
+ fails "Module#refine for methods accessed indirectly is honored by Symbol#to_proc" # Expected ["1", "2", "3"] == ["(1)", "(2)", "(3)"] to be truthy but was false
166
+ fails "Module#refine for methods accessed indirectly is honored by string interpolation" # Expected "1" == "foo" to be truthy but was false
167
+ fails "Module#refine makes available all refinements from the same module" # NoMethodError: undefined method `to_json_format' for {1=>2}
168
+ fails "Module#refine method lookup looks in the included modules for builtin methods" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x3cece>
154
169
  fails "Module#refine method lookup looks in the object singleton class first" # Expected "foo from refinement" == "foo from singleton class" to be truthy but was false
155
170
  fails "Module#refine module inclusion activates all refinements from all ancestors" # NoMethodError: undefined method `to_json_format' for 5
156
171
  fails "Module#refine module inclusion overrides methods of ancestors by methods in descendants" # NoMethodError: undefined method `to_json_format' for 5
157
172
  fails "Module#refine raises ArgumentError if not given a block" # Expected ArgumentError but got: LocalJumpError (no block given)
158
- fails "Module#refine raises TypeError if not passed a class" # Expected TypeError but no exception was raised (#<Module:0x1abe8> was returned)
159
- fails "Module#remove_const calls #to_str to convert the given name to a String"
160
- fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails"
161
- fails "Module#ruby2_keywords acceps String as well" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x40040>>
162
- fails "Module#ruby2_keywords marks the final hash argument as keyword hash" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x40036>>
163
- fails "Module#ruby2_keywords prints warning when a method accepts keyword splat" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x4001e>>
164
- fails "Module#ruby2_keywords prints warning when a method accepts keywords" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x40048>>
165
- fails "Module#ruby2_keywords prints warning when a method does not accept argument splat" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x4002e>>
166
- fails "Module#ruby2_keywords raises NameError when passed not existing method name" # Expected NameError (/undefined method `not_existing'/) but got: NoMethodError (undefined method `ruby2_keywords' for #<Class:#<Object:0x4003a>>)
167
- fails "Module#ruby2_keywords raises TypeError when passed not Symbol or String" # Expected TypeError (/is not a symbol nor a string/) but got: NoMethodError (undefined method `ruby2_keywords' for #<Class:#<Object:0x40026>>)
168
- fails "Module#ruby2_keywords returns nil" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x40044>>
169
- fails "Module#to_s always show the refinement name, even if the module is named" # NoMethodError: undefined method `refine' for ModuleSpecs::RefinementInspect
170
- fails "Module#to_s does not call #inspect or #to_s for singleton classes" # Expected "#<Class:#<:0x25bee>>" =~ /\A#<Class:#<#<Class:0x25bf2>:0x\h+>>\z/ to be truthy but was nil
171
- fails "Module#to_s for objects includes class name and object ID" # Expected "#<Class:#<ModuleSpecs::NamedClass:0xa424>>" =~ /^#<Class:#<ModuleSpecs::NamedClass:0x\h+>>$/ to be truthy but was nil
172
- fails "Module#to_s for the singleton class of an object of an anonymous class" # Expected "#<Class:#<:0xa450>>" == "#<Class:#<#<Class:0xa454>:0xa450>>" to be truthy but was false
173
- fails "Module#to_s works with an anonymous class" # Expected "#<Class:0xa482>" =~ /^#<Class:0x\h+>$/ to be truthy but was nil
174
- fails "Module#to_s works with an anonymous module" # Expected "#<Module:0xa4ae>" =~ /^#<Module:0x\h+>$/ to be truthy but was nil
175
- fails "Module#undef_method raises a NameError when passed a missing name for a class" # Expected NameError (/undefined method `not_exist' for class `#<Class:0xa514>'/) but got: NameError (method 'not_exist' not defined in )
173
+ fails "Module#refine raises TypeError if not passed a class" # Expected TypeError but got: Exception (Cannot create property '$$id' on string 'foo')
174
+ fails "Module#remove_const calls #to_str to convert the given name to a String" # Mock 'CS_CONST257' expected to receive to_str("any_args") exactly 1 times but received it 0 times
175
+ fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails" # Expected TypeError but got: NameError (constant ConstantSpecs::ConstantSpecs not defined)
176
+ fails "Module#ruby2_keywords accepts String as well" # Expected false == true to be truthy but was false
177
+ fails "Module#ruby2_keywords applies to the underlying method and applies across aliasing" # Expected false == true to be truthy but was false
178
+ fails "Module#ruby2_keywords does NOT copy the Hash when calling a method taking (*args)" # Expected false == true to be truthy but was false
179
+ fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (**kw)" # Expected false == true to be truthy but was false
180
+ fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (arg)" # Expected false == true to be truthy but was false
181
+ fails "Module#ruby2_keywords makes a copy of the hash and only marks the copy as keyword hash" # Expected false == true to be truthy but was false
182
+ fails "Module#ruby2_keywords marks the final hash argument as keyword hash" # Expected false == true to be truthy but was false
183
+ fails "Module#ruby2_keywords prints warning when a method accepts keyword splat" # Expected warning to match: /Skipping set of ruby2_keywords flag for/ but got: ""
184
+ fails "Module#ruby2_keywords prints warning when a method accepts keywords" # Expected warning to match: /Skipping set of ruby2_keywords flag for/ but got: ""
185
+ fails "Module#ruby2_keywords prints warning when a method does not accept argument splat" # Expected warning to match: /Skipping set of ruby2_keywords flag for/ but got: ""
186
+ fails "Module#ruby2_keywords raises NameError when passed not existing method name" # Expected NameError (/undefined method `not_existing'/) but no exception was raised (nil was returned)
187
+ fails "Module#ruby2_keywords raises TypeError when passed not Symbol or String" # Expected TypeError (/is not a symbol nor a string/) but no exception was raised (nil was returned)
188
+ fails "Module#to_s always show the refinement name, even if the module is named" # Expected "ModuleSpecs::RefinementInspect::R" == "#<refinement:String@ModuleSpecs::RefinementInspect>" to be truthy but was false
189
+ fails "Module#to_s does not call #inspect or #to_s for singleton classes" # Expected "#<Class:#<:0x599ac>>" =~ /\A#<Class:#<#<Class:0x599b0>:0x\h+>>\z/ to be truthy but was nil
190
+ fails "Module#to_s for objects includes class name and object ID" # Expected "#<Class:#<ModuleSpecs::NamedClass:0x599e2>>" =~ /^#<Class:#<ModuleSpecs::NamedClass:0x\h+>>$/ to be truthy but was nil
191
+ fails "Module#to_s for the singleton class of an object of an anonymous class" # Expected "#<Class:#<:0x59a16>>" == "#<Class:#<#<Class:0x59a1a>:0x59a16>>" to be truthy but was false
192
+ fails "Module#to_s works with an anonymous class" # Expected "#<Class:0x59a4c>" =~ /^#<Class:0x\h+>$/ to be truthy but was nil
193
+ fails "Module#to_s works with an anonymous module" # Expected "#<Module:0x59a80>" =~ /^#<Module:0x\h+>$/ to be truthy but was nil
194
+ fails "Module#undef_method raises a NameError when passed a missing name for a class" # Expected NameError (/undefined method `not_exist' for class `#<Class:0x1219e>'/) but got: NameError (method 'not_exist' not defined in )
176
195
  fails "Module#undef_method raises a NameError when passed a missing name for a metaclass" # Expected NameError (/undefined method `not_exist' for class `String'/) but got: NameError (method 'not_exist' not defined in )
177
- fails "Module#undef_method raises a NameError when passed a missing name for a module" # Expected NameError (/undefined method `not_exist' for module `#<Module:0xa502>'/) but got: NameError (method 'not_exist' not defined in )
178
- fails "Module#undef_method raises a NameError when passed a missing name for a singleton class" # Expected NameError (/undefined method `not_exist' for class `#<Class:#<:0xa51a>>'/) but got: NameError (method 'not_exist' not defined in )
179
- fails "Module#using does not accept class" # Expected TypeError but no exception was raised (#<Module:0x3dd76> was returned)
196
+ fails "Module#undef_method raises a NameError when passed a missing name for a module" # Expected NameError (/undefined method `not_exist' for module `#<Module:0x121a6>'/) but got: NameError (method 'not_exist' not defined in )
197
+ fails "Module#undef_method raises a NameError when passed a missing name for a singleton class" # Expected NameError (/undefined method `not_exist' for class `#<Class:#<:0x121c2>>'/) but got: NameError (method 'not_exist' not defined in )
198
+ fails "Module#using does not accept class" # Expected TypeError but no exception was raised (#<Module:0x3a10e> was returned)
180
199
  fails "Module#using imports class refinements from module into the current class/module" # NoMethodError: undefined method `foo' for 1
181
- fails "Module#using raises TypeError if passed something other than module" # Expected TypeError but no exception was raised (#<Module:0x3dd66> was returned)
200
+ fails "Module#using raises TypeError if passed something other than module" # Expected TypeError but no exception was raised (#<Module:0x3a124> was returned)
182
201
  fails "Module#using scope of refinement is active for block called via instance_eval" # TypeError: can't define singleton
183
202
  fails "Module#using scope of refinement is active for block called via instance_exec" # NoMethodError: undefined method `foo' for 1
184
203
  fails "Module#using scope of refinement is active for class defined via Class.new {}" # NoMethodError: undefined method `foo' for 1
185
204
  fails "Module#using scope of refinement is active for module defined via Module.new {}" # NoMethodError: undefined method `foo' for 1
186
- fails "Module#using works in classes too" # NoMethodError: undefined method `foo' for 1
205
+ fails "Module#using works in classes too" # NoMethodError: undefined method `foo' for 1
206
+ fails_badly "Module#ancestors returns a list of modules included in self (including self)" # Expected [ModuleSpecs::Parent, Object, Shellwords, Kernel, BasicObject] == [ModuleSpecs::Parent, Object, Kernel, BasicObject] to be truthy but was false -- a random failure
187
207
  fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#instance_method" # NameError: undefined method `foo' for class `'
188
208
  fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#method" # NameError: undefined method `foo' for class `#<Class:0x581e4>'
189
209
  fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#respond_to?" # Expected false == true to be truthy but was false
@@ -3,10 +3,10 @@ opal_filter "Numeric" do
3
3
  fails "Numeric#clone does not change frozen status" # Expected false == true to be truthy but was false
4
4
  fails "Numeric#clone raises ArgumentError if passed freeze: false" # Expected ArgumentError (/can't unfreeze/) but no exception was raised (1 was returned)
5
5
  fails "Numeric#dup does not change frozen status" # Expected false == true to be truthy but was false
6
- fails "Numeric#remainder returns the result of calling self#% with other - other if self is greater than 0 and other is less than 0"
7
- fails "Numeric#remainder returns the result of calling self#% with other - other if self is less than 0 and other is greater than 0"
8
- fails "Numeric#remainder returns the result of calling self#% with other if self and other are greater than 0"
9
- fails "Numeric#remainder returns the result of calling self#% with other if self and other are less than 0"
10
- fails "Numeric#remainder returns the result of calling self#% with other if self is 0"
11
- fails "Numeric#singleton_method_added raises a TypeError when trying to define a singleton method on a Numeric"
6
+ fails "Numeric#remainder returns the result of calling self#% with other - other if self is greater than 0 and other is less than 0" # Mock '#<NumericSpecs::Subclass:0x5c1ee>' expected to receive %(#<MockObject:0x5c1f2 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times
7
+ fails "Numeric#remainder returns the result of calling self#% with other - other if self is less than 0 and other is greater than 0" # Mock '#<NumericSpecs::Subclass:0x5c182>' expected to receive %(#<MockObject:0x5c186 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times
8
+ fails "Numeric#remainder returns the result of calling self#% with other if self and other are greater than 0" # Mock '#<NumericSpecs::Subclass:0x5c1d0>' expected to receive %(#<MockObject:0x5c1d4 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times
9
+ fails "Numeric#remainder returns the result of calling self#% with other if self and other are less than 0" # Mock '#<NumericSpecs::Subclass:0x5c1a0>' expected to receive %(#<MockObject:0x5c1a4 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times
10
+ fails "Numeric#remainder returns the result of calling self#% with other if self is 0" # Mock '#<NumericSpecs::Subclass:0x5c1be>' expected to receive %(#<MockObject:0x5c1c2 @name="Passed Object" @null=nil>) exactly 1 times but received it 0 times
11
+ fails "Numeric#singleton_method_added raises a TypeError when trying to define a singleton method on a Numeric" # Expected TypeError but no exception was raised ("test" was returned)
12
12
  end