opal 1.6.1 → 1.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +17 -0
- data/Gemfile +1 -0
- data/HACKING.md +47 -26
- data/UNRELEASED.md +28 -0
- data/benchmark/benchmarks +415 -103
- data/benchmark/bm_call_overhead.yml +28 -0
- data/benchmark/run.rb +61 -40
- data/docs/cdp_common.json +3364 -0
- data/docs/cdp_common.md +18 -0
- data/docs/{headless_chrome.md → headless_browsers.md} +31 -12
- data/lib/opal/ast/builder.rb +1 -1
- data/lib/opal/builder.rb +6 -1
- data/lib/opal/builder_processors.rb +5 -3
- data/lib/opal/cache.rb +1 -7
- data/lib/opal/cli_options.rb +72 -58
- data/lib/opal/cli_runners/chrome.rb +47 -9
- data/lib/opal/cli_runners/chrome_cdp_interface.rb +238 -112
- data/lib/opal/cli_runners/compiler.rb +146 -13
- data/lib/opal/cli_runners/deno.rb +32 -0
- data/lib/opal/cli_runners/firefox.rb +350 -0
- data/lib/opal/cli_runners/firefox_cdp_interface.rb +212 -0
- data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.cmd +17 -0
- data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.ps1 +28 -0
- data/lib/opal/cli_runners/node_modules/.package-lock.json +41 -0
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/LICENSE +1 -1
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/README.md +322 -182
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/bin/client.js +99 -114
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/chrome-remote-interface.js +1 -11
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js +16 -11
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/api.js +41 -33
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/chrome.js +224 -214
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/devtools.js +71 -191
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js +26 -6
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/protocol.json +20788 -9049
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/websocket-wrapper.js +10 -3
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/package.json +59 -123
- data/lib/opal/cli_runners/node_modules/chrome-remote-interface/webpack.config.js +25 -32
- data/lib/opal/cli_runners/node_modules/commander/History.md +298 -0
- data/lib/opal/cli_runners/node_modules/commander/LICENSE +22 -0
- data/lib/opal/cli_runners/node_modules/commander/Readme.md +217 -61
- data/lib/opal/cli_runners/node_modules/commander/index.js +431 -145
- data/lib/opal/cli_runners/node_modules/commander/package.json +16 -79
- data/lib/opal/cli_runners/node_modules/ws/README.md +334 -98
- data/lib/opal/cli_runners/node_modules/ws/browser.js +8 -0
- data/lib/opal/cli_runners/node_modules/ws/index.js +5 -10
- data/lib/opal/cli_runners/node_modules/ws/lib/buffer-util.js +129 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/constants.js +10 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/event-target.js +184 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/extension.js +223 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/limiter.js +55 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/permessage-deflate.js +518 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/receiver.js +607 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/sender.js +409 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/stream.js +180 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/validation.js +104 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/websocket-server.js +447 -0
- data/lib/opal/cli_runners/node_modules/ws/lib/websocket.js +1195 -0
- data/lib/opal/cli_runners/node_modules/ws/package.json +40 -106
- data/lib/opal/cli_runners/package-lock.json +62 -0
- data/lib/opal/cli_runners/package.json +1 -1
- data/lib/opal/cli_runners.rb +26 -4
- data/lib/opal/nodes/args/prepare_post_args.rb +2 -2
- data/lib/opal/nodes/def.rb +8 -8
- data/lib/opal/nodes/iter.rb +12 -12
- data/lib/opal/nodes/logic.rb +1 -1
- data/lib/opal/nodes/masgn.rb +2 -2
- data/lib/opal/parser/with_ruby_lexer.rb +1 -1
- data/lib/opal/paths.rb +14 -0
- data/lib/opal/rewriter.rb +2 -0
- data/lib/opal/rewriters/forward_args.rb +52 -4
- data/lib/opal/rewriters/targeted_patches.rb +94 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/basic_object.rb +1 -1
- data/opal/corelib/boolean.rb +2 -2
- data/opal/corelib/class.rb +11 -0
- data/opal/corelib/constants.rb +3 -3
- data/opal/corelib/enumerable.rb +4 -0
- data/opal/corelib/enumerator.rb +1 -1
- data/opal/corelib/hash.rb +2 -2
- data/opal/corelib/helpers.rb +1 -1
- data/opal/corelib/kernel.rb +3 -3
- data/opal/corelib/method.rb +1 -1
- data/opal/corelib/module.rb +29 -8
- data/opal/corelib/proc.rb +7 -5
- data/opal/corelib/runtime.js +141 -78
- data/opal/corelib/set.rb +252 -0
- data/opal/corelib/string.rb +2 -1
- data/opal/corelib/time.rb +2 -2
- data/opal/opal.rb +1 -0
- data/opal.gemspec +1 -0
- data/spec/filters/bugs/array.rb +22 -13
- data/spec/filters/bugs/base64.rb +5 -5
- data/spec/filters/bugs/basicobject.rb +16 -8
- data/spec/filters/bugs/bigdecimal.rb +161 -160
- data/spec/filters/bugs/binding.rb +10 -10
- data/spec/filters/bugs/class.rb +8 -8
- data/spec/filters/bugs/complex.rb +2 -1
- data/spec/filters/bugs/date.rb +79 -81
- data/spec/filters/bugs/datetime.rb +29 -29
- data/spec/filters/bugs/delegate.rb +1 -3
- data/spec/filters/bugs/encoding.rb +69 -69
- data/spec/filters/bugs/enumerable.rb +22 -20
- data/spec/filters/bugs/enumerator.rb +88 -85
- data/spec/filters/bugs/exception.rb +46 -40
- data/spec/filters/bugs/file.rb +32 -32
- data/spec/filters/bugs/float.rb +26 -21
- data/spec/filters/bugs/freeze.rb +88 -0
- data/spec/filters/bugs/hash.rb +39 -38
- data/spec/filters/bugs/integer.rb +57 -44
- data/spec/filters/bugs/io.rb +1 -1
- data/spec/filters/bugs/kernel.rb +349 -269
- data/spec/filters/bugs/language.rb +220 -188
- data/spec/filters/bugs/main.rb +5 -3
- data/spec/filters/bugs/marshal.rb +38 -38
- data/spec/filters/bugs/math.rb +2 -1
- data/spec/filters/bugs/method.rb +73 -62
- data/spec/filters/bugs/module.rb +163 -143
- data/spec/filters/bugs/numeric.rb +6 -6
- data/spec/filters/bugs/objectspace.rb +16 -16
- data/spec/filters/bugs/openstruct.rb +1 -1
- data/spec/filters/bugs/pack_unpack.rb +51 -51
- data/spec/filters/bugs/pathname.rb +7 -7
- data/spec/filters/bugs/proc.rb +63 -63
- data/spec/filters/bugs/random.rb +7 -6
- data/spec/filters/bugs/range.rb +12 -9
- data/spec/filters/bugs/rational.rb +8 -7
- data/spec/filters/bugs/regexp.rb +49 -48
- data/spec/filters/bugs/ruby-32.rb +56 -0
- data/spec/filters/bugs/set.rb +30 -30
- data/spec/filters/bugs/singleton.rb +4 -4
- data/spec/filters/bugs/string.rb +187 -99
- data/spec/filters/bugs/stringio.rb +7 -0
- data/spec/filters/bugs/stringscanner.rb +68 -68
- data/spec/filters/bugs/struct.rb +11 -9
- data/spec/filters/bugs/symbol.rb +1 -1
- data/spec/filters/bugs/time.rb +78 -63
- data/spec/filters/bugs/trace_point.rb +4 -4
- data/spec/filters/bugs/unboundmethod.rb +32 -17
- data/spec/filters/bugs/warnings.rb +8 -12
- data/spec/filters/unsupported/array.rb +24 -107
- data/spec/filters/unsupported/basicobject.rb +12 -12
- data/spec/filters/unsupported/bignum.rb +27 -52
- data/spec/filters/unsupported/class.rb +1 -2
- data/spec/filters/unsupported/delegator.rb +3 -3
- data/spec/filters/unsupported/enumerable.rb +2 -9
- data/spec/filters/unsupported/enumerator.rb +2 -11
- data/spec/filters/unsupported/file.rb +1 -1
- data/spec/filters/unsupported/float.rb +28 -47
- data/spec/filters/unsupported/hash.rb +8 -14
- data/spec/filters/unsupported/integer.rb +75 -91
- data/spec/filters/unsupported/kernel.rb +17 -35
- data/spec/filters/unsupported/language.rb +11 -19
- data/spec/filters/unsupported/marshal.rb +22 -41
- data/spec/filters/unsupported/matchdata.rb +28 -52
- data/spec/filters/unsupported/math.rb +1 -1
- data/spec/filters/unsupported/privacy.rb +229 -285
- data/spec/filters/unsupported/range.rb +1 -5
- data/spec/filters/unsupported/regexp.rb +40 -66
- data/spec/filters/unsupported/set.rb +2 -2
- data/spec/filters/unsupported/singleton.rb +4 -4
- data/spec/filters/unsupported/string.rb +305 -508
- data/spec/filters/unsupported/struct.rb +3 -4
- data/spec/filters/unsupported/symbol.rb +15 -18
- data/spec/filters/unsupported/thread.rb +1 -7
- data/spec/filters/unsupported/time.rb +159 -202
- data/spec/filters/unsupported/usage_of_files.rb +170 -259
- data/spec/lib/builder_spec.rb +4 -4
- data/spec/lib/rewriters/forward_args_spec.rb +32 -12
- data/spec/mspec-opal/runner.rb +2 -0
- data/spec/ruby_specs +4 -0
- data/stdlib/deno/base.rb +28 -0
- data/stdlib/deno/file.rb +340 -0
- data/stdlib/{headless_chrome.rb → headless_browser/base.rb} +1 -1
- data/stdlib/headless_browser/file.rb +15 -0
- data/stdlib/headless_browser.rb +4 -0
- data/stdlib/native.rb +1 -1
- data/stdlib/nodejs/file.rb +5 -0
- data/stdlib/opal/platform.rb +8 -6
- data/stdlib/opal-platform.rb +14 -8
- data/stdlib/set.rb +1 -258
- data/tasks/benchmarking.rake +62 -19
- data/tasks/performance.rake +1 -1
- data/tasks/testing.rake +5 -3
- data/test/nodejs/test_file.rb +29 -10
- data/test/opal/http_server.rb +28 -11
- data/test/opal/unsupported_and_bugs.rb +2 -1
- metadata +91 -52
- data/lib/opal/cli_runners/node_modules/ultron/LICENSE +0 -22
- data/lib/opal/cli_runners/node_modules/ultron/index.js +0 -138
- data/lib/opal/cli_runners/node_modules/ultron/package.json +0 -112
- data/lib/opal/cli_runners/node_modules/ws/SECURITY.md +0 -33
- data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.fallback.js +0 -56
- data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.js +0 -15
- data/lib/opal/cli_runners/node_modules/ws/lib/ErrorCodes.js +0 -28
- data/lib/opal/cli_runners/node_modules/ws/lib/EventTarget.js +0 -158
- data/lib/opal/cli_runners/node_modules/ws/lib/Extensions.js +0 -69
- data/lib/opal/cli_runners/node_modules/ws/lib/PerMessageDeflate.js +0 -339
- data/lib/opal/cli_runners/node_modules/ws/lib/Receiver.js +0 -520
- data/lib/opal/cli_runners/node_modules/ws/lib/Sender.js +0 -438
- data/lib/opal/cli_runners/node_modules/ws/lib/Validation.fallback.js +0 -9
- data/lib/opal/cli_runners/node_modules/ws/lib/Validation.js +0 -17
- data/lib/opal/cli_runners/node_modules/ws/lib/WebSocket.js +0 -705
- data/lib/opal/cli_runners/node_modules/ws/lib/WebSocketServer.js +0 -336
- data/spec/filters/bugs/boolean.rb +0 -3
- data/spec/filters/bugs/matrix.rb +0 -3
- data/spec/filters/unsupported/fixnum.rb +0 -15
- data/spec/filters/unsupported/freeze.rb +0 -102
- data/spec/filters/unsupported/pathname.rb +0 -4
- data/spec/filters/unsupported/proc.rb +0 -4
- data/spec/filters/unsupported/random.rb +0 -5
- data/spec/filters/unsupported/taint.rb +0 -162
data/spec/filters/bugs/main.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "main" do
|
3
|
-
fails "main#include in a file loaded with wrapping includes the given Module in the load wrapper" # ArgumentError: [MSpecEnv#load] wrong number of arguments(2
|
4
|
-
fails "main#private raises a NameError when at least one of given method names is undefined" # Expected NameError but no exception was raised (
|
3
|
+
fails "main#include in a file loaded with wrapping includes the given Module in the load wrapper" # ArgumentError: [MSpecEnv#load] wrong number of arguments (given 2, expected 1)
|
4
|
+
fails "main#private raises a NameError when at least one of given method names is undefined" # Expected NameError but no exception was raised (["main_public_method", "main_undefined_method"] was returned)
|
5
5
|
fails "main#private when multiple arguments are passed sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
|
6
6
|
fails "main#private when single argument is passed and is an array sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
|
7
7
|
fails "main#private when single argument is passed and it is not an array sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
|
8
|
-
fails "main#public raises a NameError when given an undefined name" # Expected NameError but no exception was raised (
|
8
|
+
fails "main#public raises a NameError when given an undefined name" # Expected NameError but no exception was raised ("main_undefined_method" was returned)
|
9
9
|
fails "main.ruby2_keywords is the same as Object.ruby2_keywords" # Expected main to have private method 'ruby2_keywords' but it does not
|
10
10
|
fails "main.using does not propagate refinements of new modules added after it is called" # Expected "quux" == "bar" to be truthy but was false
|
11
|
+
fails "main.using raises error when called from method in wrapped script" # Expected RuntimeError but got: ArgumentError ([MSpecEnv#load] wrong number of arguments (given 2, expected 1))
|
12
|
+
fails "main.using raises error when called on toplevel from module" # Expected RuntimeError but got: ArgumentError ([MSpecEnv#load] wrong number of arguments (given 2, expected 1))
|
11
13
|
fails "main.using requires one Module argument" # Expected TypeError but no exception was raised (main was returned)
|
12
14
|
fails "main.using uses refinements from the given module for method calls in the target file" # LoadError: cannot load such file -- ruby/core/main/fixtures/string_refinement_user
|
13
15
|
fails "main.using uses refinements from the given module only in the target file" # LoadError: cannot load such file -- ruby/core/main/fixtures/string_refinement_user
|
@@ -1,49 +1,49 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Marshal" do
|
3
|
-
fails "Marshal.dump ignores the recursion limit if the limit is negative" #
|
4
|
-
fails "Marshal.dump raises a TypeError if dumping a Mutex instance" # Expected TypeError but no exception was raised ("\
|
5
|
-
fails "Marshal.dump when passed a StringIO should raise an error" # Expected TypeError but no exception was raised ("\
|
6
|
-
fails "Marshal.dump with a Regexp dumps a Regexp subclass" #
|
7
|
-
fails "Marshal.dump with a Regexp dumps a Regexp with instance variables" #
|
3
|
+
fails "Marshal.dump ignores the recursion limit if the limit is negative" # ArgumentError: [Marshal.dump] wrong number of arguments (given 2, expected 1)
|
4
|
+
fails "Marshal.dump raises a TypeError if dumping a Mutex instance" # Expected TypeError but no exception was raised ( "\x04\bo: Mutex\x06:\f@lockedF" was returned)
|
5
|
+
fails "Marshal.dump when passed a StringIO should raise an error" # Expected TypeError but no exception was raised ( "\x04\bo:\rStringIO :\f@string\"\x00:\x0E@positioni\x00:\b@fd0:\v@flags\"\arw:\t@eofF" was returned)
|
6
|
+
fails "Marshal.dump with a Regexp dumps a Regexp subclass" # Expected "\x04\b/\t(?:)\x00" == "\x04\bIC:\x0FUserRegexp/\x00\x00\x06:\x06EF" to be truthy but was false
|
7
|
+
fails "Marshal.dump with a Regexp dumps a Regexp with instance variables" # Expected "\x04\bI/\t(?:)\x00\x06: @ivar\"\tivar" == "\x04\bI/\x00\x00\a:\x06EF: @ivar:\tivar" to be truthy but was false
|
8
8
|
fails "Marshal.dump with a Struct dumps an extended Struct" # Expected "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a\"\x06a\"\ahi:\x06b[\a\" Meths@\b" == "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a;\a\"\ahi:\x06b[\a;\x00@\a" to be truthy but was false
|
9
9
|
fails "Marshal.dump with a Symbol dumps multiple Symbols sharing the same encoding" # Expected "\x04\b[\a\"\tâ\x82¬a\"\tâ\x82¬b" == "\u0004\b[\aI:\tâ\u0082¬a\u0006:\u0006ETI:\tâ\u0082¬b\u0006;\u0006T" to be truthy but was false
|
10
|
-
fails "Marshal.dump with a Time dumps the zone and the offset"
|
10
|
+
fails "Marshal.dump with a Time dumps the zone and the offset" # NoMethodError: undefined method `default_internal' for Encoding
|
11
11
|
fails "Marshal.dump with a Time dumps the zone, but not the offset if zone is UTC" # NoMethodError: undefined method `default_internal' for Encoding
|
12
|
-
fails "Marshal.dump with an Exception contains the filename in the backtrace"
|
13
|
-
fails "Marshal.dump with an Exception dumps an empty Exception"
|
14
|
-
fails "Marshal.dump with an Exception dumps instance variables if they exist" # Expected "\
|
15
|
-
fails "Marshal.dump with an Exception dumps the cause for the exception" #
|
16
|
-
fails "Marshal.dump with an Exception dumps the message for the exception"
|
17
|
-
fails "Marshal.dump with an Object dumps a BasicObject subclass if it defines respond_to?"
|
12
|
+
fails "Marshal.dump with an Exception contains the filename in the backtrace" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0:\x0F@backtrace[\x06\"\x12foo/bar.rb:10" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt[\x06\"\x12foo/bar.rb:10" to be truthy but was false
|
13
|
+
fails "Marshal.dump with an Exception dumps an empty Exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg0:\abt0" to be truthy but was false
|
14
|
+
fails "Marshal.dump with an Exception dumps instance variables if they exist" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0: @ivari\x06" == "\x04\bo:\x0EException\b:\tmesg\"\bfoo:\abt0: @ivari\x06" to be truthy but was false
|
15
|
+
fails "Marshal.dump with an Exception dumps the cause for the exception" # Expected "StandardError" == "the cause" to be truthy but was false
|
16
|
+
fails "Marshal.dump with an Exception dumps the message for the exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt0" to be truthy but was false
|
17
|
+
fails "Marshal.dump with an Object dumps a BasicObject subclass if it defines respond_to?" # NoMethodError: undefined method `object_id' for #<MarshalSpec::BasicObjectSubWithRespondToFalse:0x8585e>
|
18
18
|
fails "Marshal.dump with an Object dumps an Object with a non-US-ASCII instance variable" # NameError: '@é' is not allowed as an instance variable name
|
19
|
-
fails "Marshal.dump with an Object raises if an Object has a singleton class and singleton methods" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\
|
20
|
-
fails "Marshal.dump with an object responding to #_dump dumps the object returned by #marshal_dump"
|
21
|
-
fails "Marshal.load for a Module loads an old module"
|
22
|
-
fails "Marshal.load for a Regexp loads a extended_user_regexp having ivar"
|
19
|
+
fails "Marshal.dump with an Object raises if an Object has a singleton class and singleton methods" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned)
|
20
|
+
fails "Marshal.dump with an object responding to #_dump dumps the object returned by #marshal_dump" # Expected "\x04\bu:\x10UserDefined\x12\x04\b[\a\" stuff@\x06" == "\x04\bu:\x10UserDefined\x12\x04\b[\a: stuff;\x00" to be truthy but was false
|
21
|
+
fails "Marshal.load for a Module loads an old module" # NotImplementedError: ModuleOld type cannot be demarshaled yet
|
22
|
+
fails "Marshal.load for a Regexp loads a extended_user_regexp having ivar" # Expected [Meths, Regexp, Object] == [Meths, UserRegexp, Regexp] to be truthy but was false
|
23
23
|
fails "Marshal.load for a Regexp loads an extended Regexp" # Expected /[a-z]/ == /(?:)/ to be truthy but was false
|
24
|
-
fails "Marshal.load for a String loads a String as BINARY if no encoding is specified at the end" # Expected #<Encoding:UTF-
|
25
|
-
fails "Marshal.load for a String loads a String subclass with custom constructor" # ArgumentError: [UserCustomConstructorString#initialize] wrong number of arguments(1
|
26
|
-
fails "Marshal.load for a Struct does not call initialize on the unmarshaled struct"
|
27
|
-
fails "Marshal.load for a Symbol loads a Symbol" # Expected #<Encoding:UTF-
|
28
|
-
fails "Marshal.load for a Symbol loads a binary encoded Symbol" # Expected "â\u0086\u0092"
|
29
|
-
fails "Marshal.load for a Symbol loads an encoded Symbol" # Expected "â\u0086\u0092"
|
30
|
-
fails "Marshal.load for a Time loads nanoseconds"
|
31
|
-
fails "Marshal.load for a Time loads"
|
32
|
-
fails "Marshal.load for a user object that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type" #
|
33
|
-
fails "Marshal.load for an Exception loads a marshalled exception with a backtrace"
|
34
|
-
fails "Marshal.load for an Exception loads a marshalled exception with a message"
|
35
|
-
fails "Marshal.load for an Exception loads a marshalled exception with no message"
|
24
|
+
fails "Marshal.load for a String loads a String as BINARY if no encoding is specified at the end" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
|
25
|
+
fails "Marshal.load for a String loads a String subclass with custom constructor" # ArgumentError: [UserCustomConstructorString#initialize] wrong number of arguments (given 1, expected 2)
|
26
|
+
fails "Marshal.load for a Struct does not call initialize on the unmarshaled struct" # Expected ["foo"] == nil to be truthy but was false
|
27
|
+
fails "Marshal.load for a Symbol loads a Symbol" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
|
28
|
+
fails "Marshal.load for a Symbol loads a binary encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false
|
29
|
+
fails "Marshal.load for a Symbol loads an encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false
|
30
|
+
fails "Marshal.load for a Time loads nanoseconds" # NoMethodError: undefined method `nsec' for 2022-12-07 05:35:14 +0100
|
31
|
+
fails "Marshal.load for a Time loads" # Expected 2022-12-07 05:35:14 +0100 == 1970-01-01 01:00:01 +0100 to be truthy but was false
|
32
|
+
fails "Marshal.load for a user object that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type" # Expected ArgumentError but got: TypeError (no implicit conversion of Hash into Integer)
|
33
|
+
fails "Marshal.load for an Exception loads a marshalled exception with a backtrace" # Expected "Exception" == "foo" to be truthy but was false
|
34
|
+
fails "Marshal.load for an Exception loads a marshalled exception with a message" # Expected "Exception" == "foo" to be truthy but was false
|
35
|
+
fails "Marshal.load for an Exception loads a marshalled exception with no message" # Expected ["<internal:corelib/class.rb>:19:1:in `allocate'", "<internal:corelib/marshal/read_buffer.rb>:392:21:in `read_object'", "<internal:corelib/marshal/read_buffer.rb>:78:9:in `read'", "<internal:corelib/marshal.rb>:14:38:in `__send__'", "<internal:corelib/basic_object.rb>:40:1:in `__send__'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `Opal.send'", "<internal:corelib/runtime.js>:2124:7:in `send'", "ruby/core/marshal/shared/load.rb:570:23:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/context.rb:176:39:in `$$17'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "<internal:corelib/enumerable.rb>:27:16:in `$$3'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "<internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `all?'", "mspec/runner/context.rb:176:18:in `protect'", "mspec/runner/context.rb:212:26:in `$$21'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "mspec/runner/mspec.rb:284:7:in `repeat'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `repeat'", "mspec/runner/context.rb:204:16:in `$$20'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:203:18:in `process'", "mspec/runner/context.rb:235:34:in `$$23'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:235:13:in `process'", "mspec/runner/mspec.rb:55:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "mspec/runner/object.rb:11:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "ruby/core/marshal/load_spec.rb:4:1:in `Opal.modules.ruby/core/marshal/load_spec'", "<internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized'", "<internal:corelib/runtime.js>:2721:5:in `load'", "<internal:corelib/kernel.rb>:535:6:in `load'", "mspec/runner/mspec.rb:99:42:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/mspec.rb:99:7:in `$$1'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/mspec.rb:90:12:in `each_file'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each_file'", "mspec/runner/mspec.rb:95:5:in `files'", "mspec/runner/mspec.rb:63:5:in `process'", "tmp/mspec_nodejs.rb:3880:6:in `undefined'", "<internal:corelib/runtime.js>:2805:7:in `<main>'", "tmp/mspec_nodejs.rb:1:1:in `null'", "node:internal/modules/cjs/loader:1105:14:in `Module._compile'", "node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js'", "node:internal/modules/cjs/loader:981:32:in `Module.load'", "node:internal/modules/cjs/loader:822:12:in `Module._load'", "node:internal/modules/run_main:77:12:in `executeUserEntryPoint'", "node:internal/main/run_main_module:17:47:in `undefined'"] == ["ruby/core/marshal/shared/load.rb:569:22:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/context.rb:176:39:in `$$17'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "<internal:corelib/enumerable.rb>:27:16:in `$$3'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "<internal:corelib/enumerable.rb>:26:7:in `Enumerable_all$ques$1'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `all?'", "mspec/runner/context.rb:176:18:in `protect'", "mspec/runner/context.rb:212:26:in `$$21'", "<internal:corelib/runtime.js>:1667:5:in `Opal.yieldX'", "mspec/runner/mspec.rb:284:7:in `repeat'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `repeat'", "mspec/runner/context.rb:204:16:in `$$20'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:203:18:in `process'", "mspec/runner/context.rb:235:34:in `$$23'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/context.rb:235:13:in `process'", "mspec/runner/mspec.rb:55:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "mspec/runner/object.rb:11:10:in `describe'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `describe'", "ruby/core/marshal/load_spec.rb:4:1:in `Opal.modules.ruby/core/marshal/load_spec'", "<internal:corelib/runtime.js>:2692:7:in `Opal.load_normalized'", "<internal:corelib/runtime.js>:2721:5:in `load'", "<internal:corelib/kernel.rb>:535:6:in `load'", "mspec/runner/mspec.rb:99:42:in `instance_exec'", "<internal:corelib/basic_object.rb>:125:1:in `instance_exec'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `instance_exec'", "mspec/runner/mspec.rb:116:11:in `protect'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `protect'", "mspec/runner/mspec.rb:99:7:in `$$1'", "<internal:corelib/runtime.js>:1644:7:in `each'", "<internal:corelib/array.rb>:983:1:in `each'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each'", "mspec/runner/mspec.rb:90:12:in `each_file'", "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1866:5:in `each_file'", "mspec/runner/mspec.rb:95:5:in `files'", "mspec/runner/mspec.rb:63:5:in `process'", "tmp/mspec_nodejs.rb:3880:6:in `undefined'", "<internal:corelib/runtime.js>:2805:7:in `<main>'", "tmp/mspec_nodejs.rb:1:1:in `null'", "node:internal/modules/cjs/loader:1105:14:in `Module._compile'", "node:internal/modules/cjs/loader:1159:10:in `Module._extensions..js'", "node:internal/modules/cjs/loader:981:32:in `Module.load'", "node:internal/modules/cjs/loader:822:12:in `Module._load'", "node:internal/modules/run_main:77:12:in `executeUserEntryPoint'", "node:internal/main/run_main_module:17:47:in `undefined'"] to be truthy but was false
|
36
36
|
fails "Marshal.load for an Exception loads an marshalled exception with ivars" # Expected "Exception" == "foo" to be truthy but was false
|
37
37
|
fails "Marshal.load for an Object loads an Object with a non-US-ASCII instance variable" # NameError: '@é' is not allowed as an instance variable name
|
38
|
-
fails "Marshal.load for an Object raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class" # Expected ArgumentError but no exception was raised (#<File:
|
38
|
+
fails "Marshal.load for an Object raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class" # Expected ArgumentError but no exception was raised (#<File:0x89744 @path="/etc/passwd"> was returned)
|
39
39
|
fails "Marshal.load for an object responding to #marshal_dump and #marshal_load loads a user-marshaled object" # Expected "\x04\b[\aU:\x10UserMarshal\"\tdata@\x06" == "\x04\b[\aU:\x10UserMarshal:\tdata;\x06" to be truthy but was false
|
40
|
-
fails "Marshal.load loads an array containing objects having _dump method, and with proc"
|
41
|
-
fails "Marshal.load loads an array containing objects having marshal_dump method, and with proc"
|
42
|
-
fails "Marshal.load when a class does not exist in the namespace raises an ArgumentError" #
|
43
|
-
fails "Marshal.load when called with a proc call the proc with fully initialized strings" # ArgumentError: [Marshal.load] wrong number of arguments(2
|
44
|
-
fails "Marshal.load when called with a proc calls the proc for recursively visited data"
|
45
|
-
fails "Marshal.load when called with a proc loads an Array with proc"
|
46
|
-
fails "Marshal.load when called with a proc no longer mutate the object after it was passed to the proc" # ArgumentError: [Marshal.load] wrong number of arguments(2
|
47
|
-
fails "Marshal.load when called with a proc returns the value of the proc"
|
48
|
-
fails "Marshal.load when called with nil for the proc argument behaves as if no proc argument was passed" # ArgumentError: [Marshal.load] wrong number of arguments(2
|
40
|
+
fails "Marshal.load loads an array containing objects having _dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
41
|
+
fails "Marshal.load loads an array containing objects having marshal_dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
42
|
+
fails "Marshal.load when a class does not exist in the namespace raises an ArgumentError" # Expected ArgumentError (undefined class/module NamespaceTest::SameName) but no exception was raised (#<SameName:0x89b06> was returned)
|
43
|
+
fails "Marshal.load when called with a proc call the proc with fully initialized strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
44
|
+
fails "Marshal.load when called with a proc calls the proc for recursively visited data" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
45
|
+
fails "Marshal.load when called with a proc loads an Array with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
46
|
+
fails "Marshal.load when called with a proc no longer mutate the object after it was passed to the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
47
|
+
fails "Marshal.load when called with a proc returns the value of the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
48
|
+
fails "Marshal.load when called with nil for the proc argument behaves as if no proc argument was passed" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
|
49
49
|
end
|
data/spec/filters/bugs/math.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Math" do
|
3
|
-
fails "Math.
|
3
|
+
fails "Math.ldexp returns correct value that closes to the max value of double type" # Expected Infinity == 9.207889385574391e+307 to be truthy but was false
|
4
|
+
fails "Math.log2 returns the natural logarithm of the argument" # Expected Infinity == 10001 to be truthy but was false
|
4
5
|
end
|
data/spec/filters/bugs/method.rb
CHANGED
@@ -1,75 +1,86 @@
|
|
1
1
|
# NOTE: run bin/format-filters after changing this file
|
2
2
|
opal_filter "Method" do
|
3
|
-
fails "Method#<< does not try to coerce argument with #to_proc" # Expected TypeError (callable object is expected) but
|
4
|
-
fails "Method#<< raises TypeError if passed not callable object" # Expected TypeError (callable object is expected) but
|
5
|
-
fails "Method#== missing methods returns true for the same method missing"
|
6
|
-
fails "Method#== returns true if a method was defined using the other one"
|
7
|
-
fails "Method#== returns true if methods are the same"
|
8
|
-
fails "Method#== returns true if the two core methods are aliases"
|
9
|
-
fails "Method#== returns true on aliased methods"
|
3
|
+
fails "Method#<< does not try to coerce argument with #to_proc" # Expected TypeError (callable object is expected) but no exception was raised (#<Proc:0x3c64> was returned)
|
4
|
+
fails "Method#<< raises TypeError if passed not callable object" # Expected TypeError (callable object is expected) but no exception was raised (#<Proc:0x3ca0> was returned)
|
5
|
+
fails "Method#== missing methods returns true for the same method missing" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
6
|
+
fails "Method#== returns true if a method was defined using the other one" # Expected false to be true
|
7
|
+
fails "Method#== returns true if methods are the same" # Expected false to be true
|
8
|
+
fails "Method#== returns true if the two core methods are aliases" # Expected false to be true
|
9
|
+
fails "Method#== returns true on aliased methods" # Expected false to be true
|
10
10
|
fails "Method#=== for a Method generated by respond_to_missing? does not call the original method name even if it now exists" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
11
11
|
fails "Method#=== for a Method generated by respond_to_missing? invokes method_missing dynamically" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
12
12
|
fails "Method#=== for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
13
13
|
fails "Method#=== for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
14
|
-
fails "Method#>> composition is a lambda" #
|
15
|
-
fails "Method#>> does not try to coerce argument with #to_proc" # Expected TypeError (callable object is expected) but
|
16
|
-
fails "Method#>> raises TypeError if passed not callable object" # Expected TypeError (callable object is expected) but
|
17
|
-
fails "Method#[] for a Method generated by respond_to_missing? does not call the original method name even if it now exists"
|
18
|
-
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing dynamically"
|
19
|
-
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments"
|
20
|
-
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result"
|
21
|
-
fails "Method#arity for a Method generated by respond_to_missing? returns -1"
|
22
|
-
fails "Method#call for a Method generated by respond_to_missing? does not call the original method name even if it now exists"
|
23
|
-
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing dynamically"
|
24
|
-
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments"
|
25
|
-
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result"
|
26
|
-
fails "Method#clone returns a copy of the method"
|
27
|
-
fails "Method#curry with optional arity argument raises ArgumentError when the method requires less arguments than the given arity"
|
28
|
-
fails "Method#curry with optional arity argument raises ArgumentError when the method requires more arguments than the given arity"
|
29
|
-
fails "Method#define_method when passed a Proc object and a method is defined inside defines the nested method in the default definee where the Proc was created" # Expected #<#<Class:
|
14
|
+
fails "Method#>> composition is a lambda" # Expected #<Proc:0x3d52>.lambda? to be truthy but was false
|
15
|
+
fails "Method#>> does not try to coerce argument with #to_proc" # Expected TypeError (callable object is expected) but no exception was raised (#<Proc:0x3cee> was returned)
|
16
|
+
fails "Method#>> raises TypeError if passed not callable object" # Expected TypeError (callable object is expected) but no exception was raised (#<Proc:0x3d2a> was returned)
|
17
|
+
fails "Method#[] for a Method generated by respond_to_missing? does not call the original method name even if it now exists" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
18
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing dynamically" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
19
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
20
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
21
|
+
fails "Method#arity for a Method generated by respond_to_missing? returns -1" # Mock 'method arity respond_to_missing' expected to receive respond_to_missing?("any_args") exactly 1 times but received it 0 times
|
22
|
+
fails "Method#call for a Method generated by respond_to_missing? does not call the original method name even if it now exists" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
23
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing dynamically" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
24
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
25
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
26
|
+
fails "Method#clone returns a copy of the method" # Expected #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> == #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> to be truthy but was false
|
27
|
+
fails "Method#curry with optional arity argument raises ArgumentError when the method requires less arguments than the given arity" # Expected ArgumentError but no exception was raised (#<Proc:0x7c68a> was returned)
|
28
|
+
fails "Method#curry with optional arity argument raises ArgumentError when the method requires more arguments than the given arity" # Expected ArgumentError but no exception was raised (#<Proc:0x7c66a> was returned)
|
29
|
+
fails "Method#define_method when passed a Proc object and a method is defined inside defines the nested method in the default definee where the Proc was created" # Expected #<#<Class:0x51aa0>:0x51a9c> NOT to have method 'nested_method_in_proc_for_define_method' but it does
|
30
30
|
fails "Method#define_method when passed a block behaves exactly like a lambda for break" # Exception: unexpected break
|
31
|
-
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #arity as the original"
|
32
|
-
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #parameters as the original"
|
33
|
-
fails "Method#eql? missing methods returns true for the same method missing"
|
34
|
-
fails "Method#eql? returns true if a method was defined using the other one"
|
35
|
-
fails "Method#eql? returns true if methods are the same"
|
36
|
-
fails "Method#eql? returns true if the two core methods are aliases"
|
37
|
-
fails "Method#eql? returns true on aliased methods"
|
38
|
-
fails "Method#hash returns the same value for builtin methods that are eql?"
|
39
|
-
fails "Method#hash returns the same value for user methods that are eql?"
|
31
|
+
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #arity as the original" # Expected -1 == -3 to be truthy but was false
|
32
|
+
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #parameters as the original" # Expected [["rest", "args"]] == [["req", "a"], ["req", "b"], ["rest", "c"]] to be truthy but was false
|
33
|
+
fails "Method#eql? missing methods returns true for the same method missing" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
34
|
+
fails "Method#eql? returns true if a method was defined using the other one" # Expected false to be true
|
35
|
+
fails "Method#eql? returns true if methods are the same" # Expected false to be true
|
36
|
+
fails "Method#eql? returns true if the two core methods are aliases" # Expected false to be true
|
37
|
+
fails "Method#eql? returns true on aliased methods" # Expected false to be true
|
38
|
+
fails "Method#hash returns the same value for builtin methods that are eql?" # Expected 282998 == 283002 to be truthy but was false
|
39
|
+
fails "Method#hash returns the same value for user methods that are eql?" # Expected 283044 == 283048 to be truthy but was false
|
40
40
|
fails "Method#inspect returns a String containing method arguments" # Expected "#<Method: MethodSpecs::Methods#zero (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:49)>".include? "()" to be truthy but was false
|
41
|
-
fails "Method#inspect returns a String containing the Module containing the method if object has a singleton class but method is not defined in the singleton class" # Expected "#<Method: MethodSpecs::MySub#bar (defined in MethodSpecs::MyMod in ruby/core/method/fixtures/classes.rb:
|
42
|
-
fails "Method#inspect returns a String containing the singleton class if method is defined in the singleton class" # Expected "#<Method: MethodSpecs::MySub#bar (defined in #<Class:#<MethodSpecs::MySub:
|
43
|
-
fails "Method#inspect returns a String including all details" # Expected "#<Method: MethodSpecs::MySub#bar (defined in MethodSpecs::MyMod in ruby/core/method/fixtures/classes.rb:
|
44
|
-
fails "Method#inspect shows the metaclass and the owner for a Module instance method retrieved from a class" # Expected "#<Method: Class#include (defined in Module in <internal:corelib/module.rb>:
|
45
|
-
fails "Method#name for a Method generated by respond_to_missing? returns the name passed to respond_to_missing?"
|
46
|
-
fails "Method#original_name returns the name of the method" # NoMethodError: undefined method `original_name' for #<Method: String#upcase (defined in String in corelib/string.rb
|
41
|
+
fails "Method#inspect returns a String containing the Module containing the method if object has a singleton class but method is not defined in the singleton class" # Expected "#<Method: MethodSpecs::MySub#bar (defined in MethodSpecs::MyMod in ruby/core/method/fixtures/classes.rb:105)>".start_with? "#<Method: MethodSpecs::MySub(MethodSpecs::MyMod)#bar" to be truthy but was false
|
42
|
+
fails "Method#inspect returns a String containing the singleton class if method is defined in the singleton class" # Expected "#<Method: MethodSpecs::MySub#bar (defined in #<Class:#<MethodSpecs::MySub:0x50826>> in ruby/core/method/shared/to_s.rb:74)>".start_with? "#<Method: #<MethodSpecs::MySub:0xXXXXXX>.bar" to be truthy but was false
|
43
|
+
fails "Method#inspect returns a String including all details" # Expected "#<Method: MethodSpecs::MySub#bar (defined in MethodSpecs::MyMod in ruby/core/method/fixtures/classes.rb:105)>".start_with? "#<Method: MethodSpecs::MySub(MethodSpecs::MyMod)#bar" to be truthy but was false
|
44
|
+
fails "Method#inspect shows the metaclass and the owner for a Module instance method retrieved from a class" # Expected "#<Method: Class#include (defined in Module in <internal:corelib/module.rb>:464)>".start_with? "#<Method: #<Class:String>(Module)#include" to be truthy but was false
|
45
|
+
fails "Method#name for a Method generated by respond_to_missing? returns the name passed to respond_to_missing?" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
46
|
+
fails "Method#original_name returns the name of the method" # NoMethodError: undefined method `original_name' for #<Method: String#upcase (defined in String in <internal:corelib/string.rb>:1685)>
|
47
47
|
fails "Method#original_name returns the original name even when aliased twice" # NoMethodError: undefined method `original_name' for #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)>
|
48
48
|
fails "Method#original_name returns the original name when aliased" # NoMethodError: undefined method `original_name' for #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)>
|
49
|
-
fails "Method#owner for a Method generated by respond_to_missing? returns the owner of the method"
|
50
|
-
fails "Method#parameters returns [[:req]] for each parameter for core methods with fixed-length argument lists" # Expected [["req", "other"]]
|
51
|
-
fails "Method#parameters returns [[:rest]] for a Method generated by respond_to_missing?"
|
49
|
+
fails "Method#owner for a Method generated by respond_to_missing? returns the owner of the method" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
50
|
+
fails "Method#parameters returns [[:req]] for each parameter for core methods with fixed-length argument lists" # Expected [["req", "other"]] == [["req"]] to be truthy but was false
|
51
|
+
fails "Method#parameters returns [[:rest]] for a Method generated by respond_to_missing?" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
52
52
|
fails "Method#parameters returns [[:rest]] for core methods with variable-length argument lists" # NameError: undefined method `delete!' for class `String'
|
53
53
|
fails "Method#parameters returns [[:rest]] or [[:opt]] for core methods with optional arguments" # Expected [[["rest"]], [["opt"]]] to include [["opt", "count"]]
|
54
|
-
fails "Method#
|
55
|
-
fails "Method#
|
56
|
-
fails "Method#
|
57
|
-
fails "Method#
|
58
|
-
fails "Method#
|
59
|
-
fails "Method#
|
60
|
-
fails "Method#
|
61
|
-
fails "Method#
|
62
|
-
fails "Method#
|
63
|
-
fails "Method#
|
64
|
-
fails "Method#
|
65
|
-
fails "Method#
|
66
|
-
fails "Method#
|
67
|
-
fails "Method#
|
68
|
-
fails "Method#
|
69
|
-
fails "Method#
|
70
|
-
fails "Method#
|
71
|
-
fails "Method#
|
72
|
-
fails "Method#
|
73
|
-
fails "Method#
|
74
|
-
fails "Method#
|
54
|
+
fails "Method#private? returns false when the method is protected" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
|
55
|
+
fails "Method#private? returns false when the method is public" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
|
56
|
+
fails "Method#private? returns true when the method is private" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
|
57
|
+
fails "Method#protected? returns false when the method is private" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
|
58
|
+
fails "Method#protected? returns false when the method is public" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
|
59
|
+
fails "Method#protected? returns true when the method is protected" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
|
60
|
+
fails "Method#public? returns false when the method is private" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
|
61
|
+
fails "Method#public? returns false when the method is protected" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
|
62
|
+
fails "Method#public? returns true when the method is public" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
|
63
|
+
fails "Method#receiver for a Method generated by respond_to_missing? returns the receiver of the method" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
64
|
+
fails "Method#source_location for a Method generated by respond_to_missing? returns nil" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
|
65
|
+
fails "Method#source_location sets the first value to the path of the file in which the method was defined" # Expected "ruby/core/method/fixtures/classes.rb" == "./ruby/core/method/fixtures/classes.rb" to be truthy but was false
|
66
|
+
fails "Method#source_location works for methods defined with an UnboundMethod" # Expected "<internal:corelib/module.rb>" =~ /ruby\/core\/method\/source_location_spec.rb/ to be truthy but was nil
|
67
|
+
fails "Method#super_method after aliasing an inherited method returns the expected super_method" # NoMethodError: undefined method `super_method' for #<Method: MethodSpecs::InheritedMethods::C#meow (defined in MethodSpecs::InheritedMethods::C in ruby/core/method/fixtures/classes.rb:233)>
|
68
|
+
fails "Method#super_method after changing an inherited methods visibility returns the expected super_method" # NoMethodError: undefined method `super_method' for #<Method: MethodSpecs::InheritedMethods::C#derp (defined in MethodSpecs::InheritedMethods::B in ruby/core/method/fixtures/classes.rb:233)>
|
69
|
+
fails "Method#super_method returns nil when the parent's method is removed" # NoMethodError: undefined method `super_method' for #<Method: #<Class:0x50682>#overridden (defined in #<Class:0x50682> in ruby/core/method/super_method_spec.rb:36)>
|
70
|
+
fails "Method#super_method returns nil when there's no super method in the parent" # NoMethodError: undefined method `super_method' for #<Method: Object#method (defined in Kernel in <internal:corelib/kernel.rb>:32)>
|
71
|
+
fails "Method#super_method returns the method that would be called by super in the method" # NoMethodError: undefined method `super_method' for #<Method: MethodSpecs::C#overridden (defined in MethodSpecs::OverrideAgain in ruby/core/method/fixtures/classes.rb:135)>
|
72
|
+
fails "Method#to_proc returns a proc that can be used by define_method" # Exception: Cannot create property '$$meta' on string 'test'
|
73
|
+
fails "Method#to_proc returns a proc that can receive a block" # LocalJumpError: no block given
|
74
|
+
fails "Method#to_proc returns a proc whose binding has the same receiver as the method" # Expected #<MethodSpecs::Methods:0x6f2d6> == nil to be truthy but was false
|
75
|
+
fails "Method#to_s does not show the defining module if it is the same as the receiver class" # Expected "#<Method:0x458aa>".start_with? "#<Method: MethodSpecs::A#baz" to be truthy but was false
|
76
|
+
fails "Method#to_s returns a String containing method arguments" # Expected "#<Method:0x4583e>".include? "()" to be truthy but was false
|
77
|
+
fails "Method#to_s returns a String containing the Module containing the method if object has a singleton class but method is not defined in the singleton class" # Expected "#<Method:0x45952>".start_with? "#<Method: MethodSpecs::MySub(MethodSpecs::MyMod)#bar" to be truthy but was false
|
78
|
+
fails "Method#to_s returns a String containing the Module the method is defined in" # Expected "#<Method:0x45870>" =~ /MethodSpecs::MyMod/ to be truthy but was nil
|
79
|
+
fails "Method#to_s returns a String containing the Module the method is referenced from" # Expected "#<Method:0x4590e>" =~ /MethodSpecs::MySub/ to be truthy but was nil
|
80
|
+
fails "Method#to_s returns a String containing the method name" # Expected "#<Method:0x45804>" =~ /\#bar/ to be truthy but was nil
|
81
|
+
fails "Method#to_s returns a String containing the singleton class if method is defined in the singleton class" # Expected "#<Method:0x45988>".start_with? "#<Method: #<MethodSpecs::MySub:0xXXXXXX>.bar" to be truthy but was false
|
82
|
+
fails "Method#to_s returns a String including all details" # Expected "#<Method:0x458dc>".start_with? "#<Method: MethodSpecs::MySub(MethodSpecs::MyMod)#bar" to be truthy but was false
|
83
|
+
fails "Method#to_s shows the metaclass and the owner for a Module instance method retrieved from a class" # Expected "#<Method: Class#include (defined in Module in <internal:corelib/module.rb>:464)>".start_with? "#<Method: #<Class:String>(Module)#include" to be truthy but was false
|
84
|
+
fails "Method#unbind keeps the origin singleton class if there is one" # Expected "#<UnboundMethod: Object#foo (defined in #<Class:#<Object:0x30684>> in ruby/core/method/unbind_spec.rb:37)>".start_with? "#<UnboundMethod: #<Class:#<Object:0x30684>>#foo" to be truthy but was false
|
85
|
+
fails "Method#unbind rebinding UnboundMethod to Method's obj produces exactly equivalent Methods" # Expected #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> == #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> to be truthy but was false
|
75
86
|
end
|