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,7 +1,6 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_unsupported_filter "Struct" do
3
- fails "Struct#initialize is private"
4
- fails "Struct.new does not create a constant with symbol as first argument"
5
- fails "Struct.new fails with invalid constant name as first argument" # this invalid name gets interpreted as a struct member
6
- fails "Struct.new raises a TypeError if object is not a Symbol"
3
+ fails "Struct#initialize is private" # Expected StructClasses::Car to have private instance method 'initialize' but it does not
4
+ fails "Struct.new does not create a constant with symbol as first argument" # Expected true to be false
5
+ fails "Struct.new fails with invalid constant name as first argument" # Expected NameError but no exception was raised (#<Class:0xa4f0> was returned)
7
6
  end
@@ -1,21 +1,18 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_unsupported_filter "Symbol" do
3
- fails "A Symbol literal can be an empty string"
4
- fails "A Symbol literal can be created by the %s-delimited expression"
5
- fails "A Symbol literal can contain null in the string"
6
- fails "A Symbol literal is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters"
7
- fails "A Symbol literal is a ':' followed by any number of valid characters"
8
- fails "A Symbol literal is converted to a literal, unquoted representation if the symbol contains only valid characters"
9
- fails "Fixnum#coerce raises a TypeError when given an Object that does not respond to #to_f"
10
- fails "Hash literal raises a TypeError if any splatted elements keys are not symbols"
11
- fails "Marshal.dump with a Symbol dumps a Symbol"
12
- fails "Marshal.dump with a Symbol dumps a big Symbol"
13
- fails "Marshal.dump with a Symbol dumps a binary encoded Symbol"
14
- fails "Marshal.dump with a Symbol dumps an encoded Symbol"
15
- fails "Marshal.dump with an Array dumps a non-empty Array" # this particular spec dumps a Symbol, spec with String instead of Symbol is in spec/opal/
16
- fails "Module#const_get raises a NameError if a Symbol has a toplevel scope qualifier"
17
- fails "Module#const_get raises a NameError if a Symbol is a scoped constant name"
18
- fails "Numeric#coerce raises a TypeError when passed a Symbol"
19
- fails "Symbol#to_proc produces a proc that always returns [[:rest]] for #parameters"
20
- fails "The throw keyword does not convert strings to a symbol"
3
+ fails "A Symbol literal can be an empty string" # Expected "\"\"" == ":\"\"" to be truthy but was false
4
+ fails "A Symbol literal can be created by the %s-delimited expression" # Expected "\"foo bar\"" == ":\"foo bar\"" to be truthy but was false
5
+ fails "A Symbol literal can contain null in the string" # Expected "\"\\u0000\"" == ":\"\\x00\"" to be truthy but was false
6
+ fails "A Symbol literal is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters" # Expected "\"foo bar\"" == ":\"foo bar\"" to be truthy but was false
7
+ fails "A Symbol literal is a ':' followed by any number of valid characters" # Expected "\"foo\"" == ":foo" to be truthy but was false
8
+ fails "A Symbol literal is converted to a literal, unquoted representation if the symbol contains only valid characters" # Expected "\"foo\"" == ":foo" to be truthy but was false
9
+ fails "Marshal.dump with a Symbol dumps a Symbol" # Expected "\x04\b\"\vsymbol" == "\x04\b:\vsymbol" to be truthy but was false
10
+ fails "Marshal.dump with a Symbol dumps a big Symbol" # Expected "\x04\b\"\x02,\x01bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig" == "\u0004\b:\u0002,\u0001bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig" to be truthy but was false
11
+ fails "Marshal.dump with a Symbol dumps a binary encoded Symbol" # Expected "\x04\b\"\x06→" == "\x04\b:\bâ\x86\x92" to be truthy but was false
12
+ fails "Marshal.dump with a Symbol dumps an encoded Symbol" # ArgumentError: unknown encoding name - utf-16
13
+ fails "Marshal.dump with an Array dumps a non-empty Array" # Expected "\x04\b[\b\"\x06ai\x06i\a" == "\x04\b[\b:\x06ai\x06i\a" to be truthy but was false
14
+ fails "Module#const_get raises a NameError if a Symbol has a toplevel scope qualifier" # Expected NameError but no exception was raised ("const1" was returned)
15
+ fails "Module#const_get raises a NameError if a Symbol is a scoped constant name" # Expected NameError but no exception was raised ("const10_10" was returned)
16
+ fails "Numeric#coerce raises a TypeError when passed a Symbol" # Expected TypeError but got: ArgumentError (invalid value for Float(): "symbol")
17
+ fails "The throw keyword does not convert strings to a symbol" # Expected ArgumentError but no exception was raised (nil was returned)
21
18
  end
@@ -1,10 +1,4 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_unsupported_filter "Thread" do
3
- fails "Module#autoload (concurrently) raises a LoadError in each thread if the file does not exist" # NotImplementedError: Thread creation not available
4
- fails "Module#autoload (concurrently) raises a NameError in each thread if the constant is not set" # NotImplementedError: Thread creation not available
5
- fails "Module#autoload loads the registered constant even if the constant was already loaded by another thread"
6
- fails "StandardError is a superclass of ThreadError"
7
- fails "The return keyword in a Thread raises a LocalJumpError if used to exit a thread"
8
- fails "The throw keyword clears the current exception"
9
- fails "The throw keyword raises an ArgumentError if used to exit a thread"
3
+ fails "The return keyword in a Thread raises a LocalJumpError if used to exit a thread" # NotImplementedError: Thread creation not available
10
4
  end
@@ -1,207 +1,164 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_unsupported_filter "Time" do
3
- fails "Time#+ accepts arguments that can be coerced into Rational"
4
- fails "Time#+ adds a negative Float"
5
- fails "Time#+ increments the time by the specified amount as rational numbers"
6
- fails "Time#+ maintains microseconds precision"
7
- fails "Time#+ maintains nanoseconds precision"
8
- fails "Time#+ maintains precision"
9
- fails "Time#+ maintains subseconds precision"
10
- fails "Time#+ returns a time with the same fixed offset as self"
11
- fails "Time#+ tracks microseconds"
12
- fails "Time#+ tracks nanoseconds"
13
- fails "Time#- accepts arguments that can be coerced into Rational"
14
- fails "Time#- maintains microseconds precision"
15
- fails "Time#- maintains nanoseconds precision"
16
- fails "Time#- maintains precision"
17
- fails "Time#- maintains subseconds precision"
18
- fails "Time#- returns a time with nanoseconds precision between two time objects"
19
- fails "Time#- returns a time with the same fixed offset as self"
20
- fails "Time#- tracks microseconds"
21
- fails "Time#- tracks nanoseconds"
22
- fails "Time#<=> returns -1 if the first argument is a fraction of a microsecond before the second argument"
23
- fails "Time#<=> returns -1 if the first argument is a point in time before the second argument (down to a microsecond)"
24
- fails "Time#<=> returns 0 if time is the same as other, including fractional microseconds"
25
- fails "Time#<=> returns 1 if the first argument is a fraction of a microsecond after the second argument"
26
- fails "Time#<=> returns 1 if the first argument is a point in time after the second argument (down to a microsecond)"
27
- fails "Time#day returns the day of the month (1..n) for a local Time"
28
- fails "Time#day returns the day of the month for a Time with a fixed offset"
29
- fails "Time#dst? dst? returns whether time is during daylight saving time"
30
- fails "Time#dup returns a subclass instance"
31
- fails "Time#eql? returns false if self and other have differing fractional microseconds"
32
- fails "Time#eql? returns false if self and other have differing numbers of microseconds"
33
- fails "Time#getgm returns a new time which is the utc representation of time"
34
- fails "Time#getlocal raises ArgumentError if the String argument is not of the form (+|-)HH:MM"
35
- fails "Time#getlocal raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds"
36
- fails "Time#getlocal raises ArgumentError if the argument represents a value less than or equal to -86400 seconds"
37
- fails "Time#getlocal returns a Time with UTC offset specified as an Integer number of seconds"
38
- fails "Time#getlocal returns a Time with a UTC offset of the specified number of Rational seconds"
39
- fails "Time#getlocal returns a Time with a UTC offset specified as +HH:MM"
40
- fails "Time#getlocal returns a Time with a UTC offset specified as -HH:MM"
41
- fails "Time#getlocal returns a new time which is the local representation of time"
42
- fails "Time#getlocal returns a new time with the correct utc_offset according to the set timezone"
43
- fails "Time#getlocal with an argument that responds to #to_int coerces using #to_int"
44
- fails "Time#getlocal with an argument that responds to #to_r coerces using #to_r"
45
- fails "Time#getlocal with an argument that responds to #to_str coerces using #to_str"
46
- fails "Time#getutc returns a new time which is the utc representation of time"
47
- fails "Time#gmt_offset given negative offset returns a negative offset"
48
- fails "Time#gmt_offset given positive offset returns a positive offset"
49
- fails "Time#gmt_offset returns offset as Rational"
50
- fails "Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change"
51
- fails "Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change"
52
- fails "Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change"
53
- fails "Time#gmt_offset returns the offset in seconds between the timezone of time and UTC"
54
- fails "Time#gmtime returns the utc representation of time"
55
- fails "Time#gmtoff given negative offset returns a negative offset"
56
- fails "Time#gmtoff given positive offset returns a positive offset"
57
- fails "Time#gmtoff returns offset as Rational"
58
- fails "Time#gmtoff returns the correct offset for Hawaii around daylight savings time change"
59
- fails "Time#gmtoff returns the correct offset for New Zealand around daylight savings time change"
60
- fails "Time#gmtoff returns the correct offset for US Eastern time zone around daylight savings time change"
61
- fails "Time#gmtoff returns the offset in seconds between the timezone of time and UTC"
62
- fails "Time#hash returns a Fixnum"
63
- fails "Time#hour returns the hour of the day (0..23) for a local Time"
64
- fails "Time#hour returns the hour of the day for a Time with a fixed offset"
65
- fails "Time#isdst dst? returns whether time is during daylight saving time"
66
- fails "Time#localtime changes the timezone according to the set one"
67
- fails "Time#localtime converts self to local time, modifying the receiver"
68
- fails "Time#localtime converts time to the UTC offset specified as an Integer number of seconds"
69
- fails "Time#localtime does nothing if already in a local time zone"
70
- fails "Time#localtime raises ArgumentError if the String argument is not of the form (+|-)HH:MM"
71
- fails "Time#localtime raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds"
72
- fails "Time#localtime raises ArgumentError if the argument represents a value less than or equal to -86400 seconds"
73
- fails "Time#localtime returns a Time with a UTC offset of the specified number of Rational seconds"
74
- fails "Time#localtime returns a Time with a UTC offset specified as +HH:MM"
75
- fails "Time#localtime returns a Time with a UTC offset specified as -HH:MM"
76
- fails "Time#localtime returns self"
77
- fails "Time#localtime with an argument that responds to #to_int coerces using #to_int"
78
- fails "Time#localtime with an argument that responds to #to_r coerces using #to_r"
79
- fails "Time#localtime with an argument that responds to #to_str coerces using #to_str"
80
- fails "Time#mday returns the day of the month (1..n) for a local Time"
81
- fails "Time#mday returns the day of the month for a Time with a fixed offset"
82
- fails "Time#min returns the minute of the hour (0..59) for a local Time"
83
- fails "Time#min returns the minute of the hour for a Time with a fixed offset"
84
- fails "Time#mon returns the four digit year for a Time with a fixed offset"
85
- fails "Time#mon returns the month of the year for a local Time"
86
- fails "Time#month returns the four digit year for a Time with a fixed offset"
87
- fails "Time#month returns the month of the year for a local Time"
88
- fails "Time#nsec returns 0 for a Time constructed with a whole number of seconds"
89
- fails "Time#nsec returns the nanoseconds part of a Time constructed with a Float number of seconds"
90
- fails "Time#nsec returns the nanoseconds part of a Time constructed with a Rational number of seconds"
91
- fails "Time#nsec returns the nanoseconds part of a Time constructed with an Float number of microseconds"
92
- fails "Time#nsec returns the nanoseconds part of a Time constructed with an Integer number of microseconds"
93
- fails "Time#nsec returns the nanoseconds part of a Time constructed with an Rational number of microseconds"
94
- fails "Time#strftime with %L formats the milliseconds of the second"
95
- fails "Time#strftime with %z formats a UTC time offset as '+0000'"
96
- fails "Time#strftime with %z formats a local time with negative UTC offset as '-HHMM'"
97
- fails "Time#strftime with %z formats a local time with positive UTC offset as '+HHMM'"
98
- fails "Time#strftime with %z formats a time with fixed negative offset as '-HHMM'"
99
- fails "Time#strftime with %z formats a time with fixed offset as '+/-HH:MM' with ':' specifier"
100
- fails "Time#strftime with %z formats a time with fixed offset as '+/-HH:MM:SS' with '::' specifier"
101
- fails "Time#strftime with %z formats a time with fixed positive offset as '+HHMM'"
102
- fails "Time#subsec returns 0 as a Fixnum for a Time with a whole number of seconds"
103
- fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Float number of seconds"
104
- fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Rational number of seconds"
105
- fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Float number of microseconds"
106
- fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Integer number of microseconds"
107
- fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Rational number of microseconds"
108
- fails "Time#to_a returns a 10 element array representing the deconstructed time"
109
- fails "Time#to_r returns a Rational even for a whole number of seconds"
110
- fails "Time#to_r returns the a Rational representing seconds and subseconds since the epoch"
111
- fails "Time#usec returns 0 for a Time constructed with an Rational number of microseconds < 1"
112
- fails "Time#usec returns the microseconds for time created by Time#local"
113
- fails "Time#usec returns the microseconds part of a Time constructed with a Rational number of seconds"
114
- fails "Time#usec returns the microseconds part of a Time constructed with an Float number of microseconds > 1"
115
- fails "Time#usec returns the microseconds part of a Time constructed with an Integer number of microseconds"
116
- fails "Time#usec returns the microseconds part of a Time constructed with an Rational number of microseconds > 1"
117
- fails "Time#utc returns the utc representation of time"
118
- fails "Time#utc_offset given negative offset returns a negative offset"
119
- fails "Time#utc_offset given positive offset returns a positive offset"
120
- fails "Time#utc_offset returns offset as Rational"
121
- fails "Time#utc_offset returns the correct offset for Hawaii around daylight savings time change"
122
- fails "Time#utc_offset returns the correct offset for New Zealand around daylight savings time change"
123
- fails "Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change"
124
- fails "Time#utc_offset returns the offset in seconds between the timezone of time and UTC"
125
- fails "Time#wday returns an integer representing the day of the week, 0..6, with Sunday being 0"
126
- fails "Time#yday returns an integer representing the day of the year, 1..366" # Expected 117 == 116
127
- fails "Time#year returns the four digit year for a Time with a fixed offset"
128
- fails "Time#year returns the four digit year for a local Time as an Integer"
129
- fails "Time#zone Encoding.default_internal is set doesn't raise errors for a Time with a fixed offset"
130
- fails "Time#zone Encoding.default_internal is set returns the string with the default internal encoding"
131
- fails "Time#zone returns UTC when called on a UTC time"
132
- fails "Time#zone returns nil for a Time with a fixed offset"
133
- fails "Time#zone returns nil when getting the local time with a fixed offset"
134
- fails "Time#zone returns the correct timezone for a local time"
135
- fails "Time#zone returns the time zone used for time"
136
- fails "Time.at passed Numeric returns a subclass instance on a Time subclass"
137
- fails "Time.at passed Time returns a subclass instance"
138
- fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Float microseconds since 1970-01-01 00:00:00 UTC"
139
- fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r coerces using #to_r"
140
- fails "Time.at with a second argument that responds to #to_r coerces using #to_r"
141
- fails "Time.gm handles fractional microseconds as a Float"
142
- fails "Time.gm handles fractional microseconds as a Rational"
143
- fails "Time.gm handles fractional seconds as a Rational"
144
- fails "Time.gm handles microseconds"
145
- fails "Time.gm ignores fractional seconds if a passed fractional number of microseconds"
146
- fails "Time.gm ignores fractional seconds if a passed whole number of microseconds"
147
- fails "Time.gm returns subclass instances"
148
- fails "Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
149
- fails "Time.local creates a time based on given values, interpreted in the local time zone"
150
- fails "Time.local creates the correct time just after dst change"
151
- fails "Time.local creates the correct time just before dst change"
152
- fails "Time.local handles fractional microseconds as a Float"
153
- fails "Time.local handles fractional microseconds as a Rational"
154
- fails "Time.local handles fractional seconds as a Rational"
155
- fails "Time.local handles microseconds"
156
- fails "Time.local ignores fractional seconds if a passed fractional number of microseconds"
157
- fails "Time.local ignores fractional seconds if a passed whole number of microseconds"
158
- fails "Time.local respects rare old timezones"
159
- fails "Time.local returns subclass instances"
160
- fails "Time.local timezone changes correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'"
161
- fails "Time.local timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'"
162
- fails "Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
163
- fails "Time.mktime creates a time based on given values, interpreted in the local time zone"
164
- fails "Time.mktime creates the correct time just after dst change"
165
- fails "Time.mktime creates the correct time just before dst change"
166
- fails "Time.mktime handles fractional microseconds as a Float"
167
- fails "Time.mktime handles fractional microseconds as a Rational"
168
- fails "Time.mktime handles fractional seconds as a Rational"
169
- fails "Time.mktime handles microseconds"
170
- fails "Time.mktime ignores fractional seconds if a passed fractional number of microseconds"
171
- fails "Time.mktime ignores fractional seconds if a passed whole number of microseconds"
172
- fails "Time.mktime respects rare old timezones"
173
- fails "Time.mktime returns subclass instances"
174
- fails "Time.mktime timezone changes correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'"
175
- fails "Time.mktime timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'"
176
- fails "Time.new creates a subclass instance if called on a subclass"
177
- fails "Time.new creates a time based on given values, interpreted in the local time zone"
178
- fails "Time.new handles fractional seconds as a Rational"
179
- fails "Time.new respects rare old timezones"
180
- fails "Time.new returns subclass instances"
181
- fails "Time.new timezone changes correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'"
182
- fails "Time.new timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'"
183
- fails "Time.new with a utc_offset argument adds one hour if the offset minute value is greater than 59"
184
- fails "Time.new with a utc_offset argument raises ArgumentError if the String argument is not of the form (+|-)HH:MM"
185
- fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds"
186
- fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value less than or equal to -86400 seconds"
187
- fails "Time.new with a utc_offset argument raises ArgumentError if the hour value is greater than 23"
188
- fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Integer seconds"
189
- fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Rational seconds"
190
- fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as +HH:MM"
191
- fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as -HH:MM"
192
- fails "Time.new with a utc_offset argument returns a local Time if the argument is nil"
193
- fails "Time.new with a utc_offset argument returns a non-UTC time"
194
- fails "Time.new with a utc_offset argument with an argument that responds to #to_int coerces using #to_int"
195
- fails "Time.new with a utc_offset argument with an argument that responds to #to_r coerces using #to_r"
196
- fails "Time.new with a utc_offset argument with an argument that responds to #to_str coerces using #to_str"
197
- fails "Time.now creates a subclass instance if called on a subclass"
198
- fails "Time.utc handles fractional microseconds as a Float"
199
- fails "Time.utc handles fractional microseconds as a Rational"
200
- fails "Time.utc handles fractional seconds as a Rational"
201
- fails "Time.utc handles microseconds"
202
- fails "Time.utc ignores fractional seconds if a passed fractional number of microseconds"
203
- fails "Time.utc ignores fractional seconds if a passed whole number of microseconds"
204
- fails "Time.utc returns subclass instances"
3
+ fails "Time#+ accepts arguments that can be coerced into Rational" # Mock '10' expected to receive to_r("any_args") exactly 1 times but received it 0 times
4
+ fails "Time#+ adds a negative Float" # Expected 700000 == 699999 to be truthy but was false
5
+ fails "Time#+ increments the time by the specified amount as rational numbers" # Expected 1970-01-01 01:00:01 +0100 == 1970-01-01 01:00:02 +0100 to be truthy but was false
6
+ fails "Time#+ maintains microseconds precision" # Expected 0 == 999999 to be truthy but was false
7
+ fails "Time#+ maintains nanoseconds precision" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:08 +0100
8
+ fails "Time#+ maintains subseconds precision" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:08 +0100
9
+ fails "Time#+ returns a time with the same fixed offset as self" # Expected 60 == 3600 to be truthy but was false
10
+ fails "Time#+ tracks microseconds" # Expected 0 == 123456 to be truthy but was false
11
+ fails "Time#+ tracks nanoseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100
12
+ fails "Time#- accepts arguments that can be coerced into Rational" # Mock '10' expected to receive to_r("any_args") exactly 1 times but received it 0 times
13
+ fails "Time#- maintains microseconds precision" # Expected 0 == 999999 to be truthy but was false
14
+ fails "Time#- maintains nanoseconds precision" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:10 +0100
15
+ fails "Time#- maintains precision" # Expected 1970-01-01 01:00:09 +0100 == 1970-01-01 01:00:09 +0100 to be falsy but was true
16
+ fails "Time#- maintains subseconds precision" # NoMethodError: undefined method `subsec' for 1970-01-01 00:59:59 +0100
17
+ fails "Time#- returns a time with nanoseconds precision between two time objects" # Expected 86399 == 86399.999999998 to be truthy but was false
18
+ fails "Time#- returns a time with the same fixed offset as self" # Expected 60 == 3600 to be truthy but was false
19
+ fails "Time#- tracks microseconds" # Expected 122000 == 123456 to be truthy but was false
20
+ fails "Time#- tracks nanoseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100
21
+ fails "Time#<=> returns -1 if the first argument is a fraction of a microsecond before the second argument" # Expected 0 == -1 to be truthy but was false
22
+ fails "Time#<=> returns -1 if the first argument is a point in time before the second argument (down to a microsecond)" # Expected 0 == -1 to be truthy but was false
23
+ fails "Time#<=> returns 1 if the first argument is a fraction of a microsecond after the second argument" # Expected 0 == 1 to be truthy but was false
24
+ fails "Time#<=> returns 1 if the first argument is a point in time after the second argument (down to a microsecond)" # Expected 0 == 1 to be truthy but was false
25
+ fails "Time#dup returns a subclass instance" # Expected 2022-12-07 04:50:25 +0100 (Time) to be an instance of #<Class:0x3828>
26
+ fails "Time#eql? returns false if self and other have differing fractional microseconds" # Expected 1970-01-01 01:01:40 +0100 not to have same value or type as 1970-01-01 01:01:40 +0100
27
+ fails "Time#eql? returns false if self and other have differing numbers of microseconds" # Expected 1970-01-01 01:01:40 +0100 not to have same value or type as 1970-01-01 01:01:40 +0100
28
+ fails "Time#getgm returns a new time which is the utc representation of time" # Expected 2007-01-09 05:00:00 UTC == 2007-01-09 12:00:00 UTC to be truthy but was false
29
+ fails "Time#getlocal raises ArgumentError if the String argument is not of the form (+|-)HH:MM" # Expected ArgumentError but got: NoMethodError (undefined method `getlocal' for 2022-12-07 04:50:51 +0100)
30
+ fails "Time#getlocal raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # NoMethodError: undefined method `getlocal' for 2022-12-07 04:50:51 +0100
31
+ fails "Time#getlocal raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # NoMethodError: undefined method `getlocal' for 2022-12-07 04:50:51 +0100
32
+ fails "Time#getlocal returns a Time with UTC offset specified as an Integer number of seconds" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC
33
+ fails "Time#getlocal returns a Time with a UTC offset of the specified number of Rational seconds" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC
34
+ fails "Time#getlocal returns a Time with a UTC offset specified as +HH:MM" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC
35
+ fails "Time#getlocal returns a Time with a UTC offset specified as -HH:MM" # NoMethodError: undefined method `getlocal' for 2007-01-09 12:00:00 UTC
36
+ fails "Time#getlocal returns a new time which is the local representation of time" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
37
+ fails "Time#getlocal returns a new time with the correct utc_offset according to the set timezone" # Expected -60 == -3600 to be truthy but was false
38
+ fails "Time#getlocal with an argument that responds to #to_int coerces using #to_int" # Mock 'integer' expected to receive to_int("any_args") exactly 1 times but received it 0 times
39
+ fails "Time#getlocal with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times
40
+ fails "Time#getlocal with an argument that responds to #to_str coerces using #to_str" # Mock 'string' expected to receive to_str("any_args") exactly 1 times but received it 0 times
41
+ fails "Time#getutc returns a new time which is the utc representation of time" # Expected 2007-01-09 05:00:00 UTC == 2007-01-09 12:00:00 UTC to be truthy but was false
42
+ fails "Time#gmt_offset given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false
43
+ fails "Time#gmt_offset given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false
44
+ fails "Time#gmt_offset returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false
45
+ fails "Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false
46
+ fails "Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false
47
+ fails "Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false
48
+ fails "Time#gmt_offset returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false
49
+ fails "Time#gmtoff given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false
50
+ fails "Time#gmtoff given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false
51
+ fails "Time#gmtoff returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false
52
+ fails "Time#gmtoff returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false
53
+ fails "Time#gmtoff returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false
54
+ fails "Time#gmtoff returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false
55
+ fails "Time#gmtoff returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false
56
+ fails "Time#localtime changes the timezone according to the set one" # Expected -60 == -3600 to be truthy but was false
57
+ fails "Time#localtime converts self to local time, modifying the receiver" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
58
+ fails "Time#localtime converts time to the UTC offset specified as an Integer number of seconds" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
59
+ fails "Time#localtime does nothing if already in a local time zone" # NoMethodError: undefined method `localtime' for 2005-02-27 22:50:00 +0100
60
+ fails "Time#localtime raises ArgumentError if the String argument is not of the form (+|-)HH:MM" # Expected ArgumentError but got: NoMethodError (undefined method `localtime' for 2022-12-07 04:50:47 +0100)
61
+ fails "Time#localtime raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # NoMethodError: undefined method `localtime' for 2022-12-07 04:50:47 +0100
62
+ fails "Time#localtime raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # NoMethodError: undefined method `localtime' for 2022-12-07 04:50:47 +0100
63
+ fails "Time#localtime returns a Time with a UTC offset of the specified number of Rational seconds" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
64
+ fails "Time#localtime returns a Time with a UTC offset specified as +HH:MM" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
65
+ fails "Time#localtime returns a Time with a UTC offset specified as -HH:MM" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
66
+ fails "Time#localtime returns self" # NoMethodError: undefined method `localtime' for 2007-01-09 12:00:00 UTC
67
+ fails "Time#localtime with an argument that responds to #to_int coerces using #to_int" # Mock 'integer' expected to receive to_int("any_args") exactly 1 times but received it 0 times
68
+ fails "Time#localtime with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times
69
+ fails "Time#localtime with an argument that responds to #to_str coerces using #to_str" # Mock 'string' expected to receive to_str("any_args") exactly 1 times but received it 0 times
70
+ fails "Time#nsec returns 0 for a Time constructed with a whole number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:01:40 +0100
71
+ fails "Time#nsec returns the nanoseconds part of a Time constructed with a Float number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:10 +0100
72
+ fails "Time#nsec returns the nanoseconds part of a Time constructed with a Rational number of seconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:01 +0100
73
+ fails "Time#nsec returns the nanoseconds part of a Time constructed with an Float number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100
74
+ fails "Time#nsec returns the nanoseconds part of a Time constructed with an Integer number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100
75
+ fails "Time#nsec returns the nanoseconds part of a Time constructed with an Rational number of microseconds" # NoMethodError: undefined method `nsec' for 1970-01-01 01:00:00 +0100
76
+ fails "Time#strftime with %L formats the milliseconds of the second" # Expected "000" == "100" to be truthy but was false
77
+ fails "Time#strftime with %z formats a UTC time offset as '+0000'" # Expected "+0100" == "+0000" to be truthy but was false
78
+ fails "Time#strftime with %z formats a local time with negative UTC offset as '-HHMM'" # Expected "+0100" == "-0800" to be truthy but was false
79
+ fails "Time#strftime with %z formats a time with fixed offset as '+/-HH:MM:SS' with '::' specifier" # Expected "+01:01.0833333333333286" == "+01:01:05" to be truthy but was false
80
+ fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Float number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:10 +0100
81
+ fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Rational number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:01 +0100
82
+ fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Float number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100
83
+ fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Integer number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100
84
+ fails "Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Rational number of microseconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:00:00 +0100
85
+ fails "Time#to_a returns a 10 element array representing the deconstructed time" # Expected [0, 0, 1, 1, 1, 1970, 4, 1, false, "Central European Standard Time"] == [0, 0, 18, 31, 12, 1969, 3, 365, false, "CST"] to be truthy but was false
86
+ fails "Time#to_r returns a Rational even for a whole number of seconds" # NoMethodError: undefined method `to_r' for 1970-01-01 01:00:02 +0100
87
+ fails "Time#to_r returns the a Rational representing seconds and subseconds since the epoch" # NoMethodError: undefined method `to_r' for 1970-01-01 01:00:01 +0100
88
+ fails "Time#usec returns the microseconds for time created by Time#local" # Expected 0 == 780000 to be truthy but was false
89
+ fails "Time#usec returns the microseconds part of a Time constructed with a Rational number of seconds" # Expected 0 == 500000 to be truthy but was false
90
+ fails "Time#usec returns the microseconds part of a Time constructed with an Float number of microseconds > 1" # Expected 0 == 3 to be truthy but was false
91
+ fails "Time#usec returns the microseconds part of a Time constructed with an Integer number of microseconds" # Expected 999000 == 999999 to be truthy but was false
92
+ fails "Time#usec returns the microseconds part of a Time constructed with an Rational number of microseconds > 1" # Expected 0 == 9 to be truthy but was false
93
+ fails "Time#utc_offset given negative offset returns a negative offset" # Expected -180 == -10800 to be truthy but was false
94
+ fails "Time#utc_offset given positive offset returns a positive offset" # Expected 180 == 10800 to be truthy but was false
95
+ fails "Time#utc_offset returns offset as Rational" # Expected 120.75000000000001 == 7245 to be truthy but was false
96
+ fails "Time#utc_offset returns the correct offset for Hawaii around daylight savings time change" # Expected 3600 == -36000 to be truthy but was false
97
+ fails "Time#utc_offset returns the correct offset for New Zealand around daylight savings time change" # Expected 7200 == 46800 to be truthy but was false
98
+ fails "Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change" # Expected 3600 == -18000 to be truthy but was false
99
+ fails "Time#utc_offset returns the offset in seconds between the timezone of time and UTC" # Expected 3600 == 10800 to be truthy but was false
100
+ fails "Time#zone Encoding.default_internal is set doesn't raise errors for a Time with a fixed offset" # NoMethodError: undefined method `default_internal' for Encoding
101
+ fails "Time#zone returns nil when getting the local time with a fixed offset" # NoMethodError: undefined method `getlocal' for 2005-02-27 22:50:00 -0100
102
+ fails "Time#zone returns the correct timezone for a local time" # NoMethodError: undefined method `getlocal' for 2005-02-27 22:50:00 -0100
103
+ fails "Time#zone returns the time zone used for time" # Expected "Central European Standard Time" == "EST" to be truthy but was false
104
+ fails "Time.at passed Numeric returns a subclass instance on a Time subclass" # Expected 1970-01-01 01:00:00 +0100 (Time) to be an instance of #<Class:0x29828>
105
+ fails "Time.at passed Time returns a subclass instance" # Expected 2022-12-07 04:50:36 +0100 (Time) to be an instance of #<Class:0x29836>
106
+ fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Float microseconds since 1970-01-01 00:00:00 UTC" # NoMethodError: undefined method `tv_nsec' for 1970-01-01 01:00:10 +0100
107
+ fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times
108
+ fails "Time.at with a second argument that responds to #to_r coerces using #to_r" # Mock 'rational' expected to receive to_r("any_args") exactly 1 times but received it 0 times
109
+ fails "Time.gm handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false
110
+ fails "Time.gm handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false
111
+ fails "Time.gm handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false
112
+ fails "Time.gm handles microseconds" # Expected 0 == 123 to be truthy but was false
113
+ fails "Time.gm ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false
114
+ fails "Time.gm ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false
115
+ fails "Time.gm returns subclass instances" # Expected 2008-12-01 00:00:00 UTC (Time) to be an instance of #<Class:0x864ca>
116
+ fails "Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false
117
+ fails "Time.local creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false
118
+ fails "Time.local creates the correct time just after dst change" # Expected 7200 == -18000 to be truthy but was false
119
+ fails "Time.local creates the correct time just before dst change" # Expected 7200 == -14400 to be truthy but was false
120
+ fails "Time.local handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false
121
+ fails "Time.local handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false
122
+ fails "Time.local handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false
123
+ fails "Time.local handles microseconds" # Expected 0 == 123 to be truthy but was false
124
+ fails "Time.local ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false
125
+ fails "Time.local ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false
126
+ fails "Time.local returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x1c7d0>
127
+ fails "Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false
128
+ fails "Time.mktime creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false
129
+ fails "Time.mktime creates the correct time just after dst change" # Expected 7200 == -18000 to be truthy but was false
130
+ fails "Time.mktime creates the correct time just before dst change" # Expected 7200 == -14400 to be truthy but was false
131
+ fails "Time.mktime handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false
132
+ fails "Time.mktime handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false
133
+ fails "Time.mktime handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false
134
+ fails "Time.mktime handles microseconds" # Expected 0 == 123 to be truthy but was false
135
+ fails "Time.mktime ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false
136
+ fails "Time.mktime ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false
137
+ fails "Time.mktime returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x5e2b2>
138
+ fails "Time.new creates a subclass instance if called on a subclass" # Expected 2022-12-07 04:51:02 +0100 (Time) to be an instance of TimeSpecs::SubTime
139
+ fails "Time.new creates a time based on given values, interpreted in the local time zone" # Expected [1, 15, 20, 1, 1, 2000, 6, 1, false, "Central European Standard Time"] == [1, 15, 20, 1, 1, 2000, 6, 1, false, "PST"] to be truthy but was false
140
+ fails "Time.new handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false
141
+ fails "Time.new returns subclass instances" # Expected 2008-12-01 00:00:00 +0100 (Time) to be an instance of #<Class:0x8e0da>
142
+ fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" # Expected 1439.9833333333333 == 86399 to be truthy but was false
143
+ fails "Time.new with a utc_offset argument raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" # Expected -1439.9833333333333 == -86399 to be truthy but was false
144
+ fails "Time.new with a utc_offset argument raises ArgumentError if the hour value is greater than 23" # Expected ArgumentError but no exception was raised (2000-01-01 00:00:00 +2400 was returned)
145
+ fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Integer seconds" # Expected 2.05 == 123 to be truthy but was false
146
+ fails "Time.new with a utc_offset argument returns a Time with a UTC offset of the specified number of Rational seconds" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String
147
+ fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as +HH:MM" # Expected 330 == 19800 to be truthy but was false
148
+ fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as -HH:MM" # ArgumentError: "+HH:MM", "-HH:MM", "UTC" expected for utc_offset: -04:10:43
149
+ fails "Time.new with a utc_offset argument returns a local Time if the argument is nil" # Expected 3600 == -28800 to be truthy but was false
150
+ fails "Time.new with a utc_offset argument returns a non-UTC time" # Expected 2000-01-01 00:00:00 UTC.utc? to be falsy but was true
151
+ fails "Time.new with a utc_offset argument with an argument that responds to #to_int coerces using #to_int" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String
152
+ fails "Time.new with a utc_offset argument with an argument that responds to #to_r coerces using #to_r" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String
153
+ fails "Time.new with a utc_offset argument with an argument that responds to #to_str coerces using #to_str" # ArgumentError: Opal doesn't support other types for a timezone argument than Integer and String
154
+ fails "Time.now creates a subclass instance if called on a subclass" # Expected 2022-12-07 04:50:35 +0100 (Time) to be an instance of TimeSpecs::SubTime
155
+ fails "Time.utc handles fractional microseconds as a Float" # Expected 0 == 1 to be truthy but was false
156
+ fails "Time.utc handles fractional microseconds as a Rational" # Expected 0 == 9 to be truthy but was false
157
+ fails "Time.utc handles fractional seconds as a Rational" # Expected 0 == 900000 to be truthy but was false
158
+ fails "Time.utc handles microseconds" # Expected 0 == 123 to be truthy but was false
159
+ fails "Time.utc ignores fractional seconds if a passed fractional number of microseconds" # Expected 750000 == 9 to be truthy but was false
160
+ fails "Time.utc ignores fractional seconds if a passed whole number of microseconds" # Expected 750000 == 2 to be truthy but was false
161
+ fails "Time.utc returns subclass instances" # Expected 2008-12-01 00:00:00 UTC (Time) to be an instance of #<Class:0x88f30>
205
162
  fails_badly "Marshal.load for a Time loads the zone" # Seasonal failure
206
163
  fails_badly "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Seasonal failure
207
164
  fails_badly "Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Seasonal failure