ruby-changes:59534
From: Benoit <ko1@a...>
Date: Sat, 28 Dec 2019 00:47:31 +0900 (JST)
Subject: [ruby-changes:59534] a2fac1d72c (master): Update to ruby/spec@d419e74
https://git.ruby-lang.org/ruby.git/commit/?id=a2fac1d72c From a2fac1d72c225192018f8f3f3dfcfcc46f66c08a Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Fri, 27 Dec 2019 16:46:08 +0100 Subject: Update to ruby/spec@d419e74 diff --git a/spec/ruby/.rubocop.yml b/spec/ruby/.rubocop.yml index 77e4e78..5dc6b96 100644 --- a/spec/ruby/.rubocop.yml +++ b/spec/ruby/.rubocop.yml @@ -10,7 +10,7 @@ AllCops: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop.yml#L10 Layout/TrailingWhitespace: Enabled: true -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Enabled: true Exclude: - library/coverage/fixtures/some_class.rb @@ -34,10 +34,10 @@ Lint/InterpolationCheck: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop.yml#L34 Lint/LiteralAsCondition: Enabled: false -Lint/UnneededRequireStatement: +Lint/RedundantRequireStatement: Enabled: false -Lint/UnneededSplatExpansion: +Lint/RedundantSplatExpansion: Enabled: false Lint/UnifiedInteger: diff --git a/spec/ruby/.rubocop_todo.yml b/spec/ruby/.rubocop_todo.yml index aac54f6..36e41ae 100644 --- a/spec/ruby/.rubocop_todo.yml +++ b/spec/ruby/.rubocop_todo.yml @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L1 # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-04-03 22:23:59 +0900 using RuboCop version 0.54.0. +# on 2019-12-12 22:16:26 +0900 using RuboCop version 0.77.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -20,7 +20,7 @@ Lint/DuplicateMethods: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L20 - 'core/unboundmethod/fixtures/classes.rb' - 'fixtures/class.rb' -# Offense count: 5 +# Offense count: 8 Lint/EnsureReturn: Exclude: - 'language/fixtures/ensure.rb' @@ -28,14 +28,16 @@ Lint/EnsureReturn: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L28 - 'language/return_spec.rb' # Offense count: 10 +Lint/FlipFlop: + Exclude: + - 'language/if_spec.rb' + - 'language/precedence_spec.rb' + +# Offense count: 10 Lint/FloatOutOfRange: Exclude: - 'core/string/modulo_spec.rb' -# Offense count: 29 -Lint/HandleExceptions: - Enabled: false - # Offense count: 2 Lint/ImplicitStringConcatenation: Exclude: @@ -58,13 +60,19 @@ Lint/InheritException: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L60 - 'core/exception/fixtures/common.rb' - 'core/module/fixtures/autoload_ex1.rb' -# Offense count: 5 +# Offense count: 72 # Cop supports --auto-correct. Lint/LiteralInInterpolation: Exclude: - 'core/module/refine_spec.rb' + - 'core/regexp/shared/new.rb' + - 'core/string/shared/to_sym.rb' + - 'language/alias_spec.rb' - 'language/defined_spec.rb' - 'language/fixtures/squiggly_heredoc.rb' + - 'language/symbol_spec.rb' + - 'language/undef_spec.rb' + - 'library/net/ftp/connect_spec.rb' # Offense count: 16 Lint/Loop: @@ -74,11 +82,11 @@ Lint/Loop: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L82 # Offense count: 8 # Cop supports --auto-correct. -Lint/MultipleCompare: +Lint/MultipleComparison: Exclude: - 'language/precedence_spec.rb' -# Offense count: 12 +# Offense count: 9 Lint/ParenthesesAsGroupedExpression: Exclude: - 'core/string/fixtures/freeze_magic_comment.rb' @@ -86,13 +94,19 @@ Lint/ParenthesesAsGroupedExpression: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L94 - 'language/fixtures/send.rb' - 'language/method_spec.rb' +# Offense count: 2 +# Cop supports --auto-correct. +Lint/RedundantStringCoercion: + Exclude: + - 'core/io/print_spec.rb' + # Offense count: 1 # Cop supports --auto-correct. Lint/RedundantWithIndex: Exclude: - 'core/enumerator/with_index_spec.rb' -# Offense count: 26 +# Offense count: 22 Lint/RescueException: Exclude: - 'command_line/fixtures/debug_info.rb' @@ -102,27 +116,24 @@ Lint/RescueException: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L116 - 'core/kernel/fixtures/autoload_frozen.rb' - 'core/module/autoload_spec.rb' - 'core/mutex/sleep_spec.rb' - - 'core/process/euid_spec.rb' - - 'core/process/setsid_spec.rb' - - 'core/process/uid_spec.rb' - 'core/thread/abort_on_exception_spec.rb' - 'core/thread/shared/exit.rb' - 'language/rescue_spec.rb' - 'library/erb/filename_spec.rb' -# Offense count: 2 +# Offense count: 4 # Configuration parameters: IgnoreImplicitReferences. Lint/ShadowedArgument: Exclude: - 'language/fixtures/super.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Lint/StringConversionInInterpolation: - Exclude: - - 'core/io/print_spec.rb' +# Offense count: 39 +# Configuration parameters: AllowComments. +Lint/SuppressedException: + Enabled: false # Offense count: 9 +# Configuration parameters: AllowKeywordBlockArguments. Lint/UnderscorePrefixedVariableName: Exclude: - 'core/io/pipe_spec.rb' @@ -137,13 +148,4 @@ Lint/UselessAccessModifier: https://github.com/ruby/ruby/blob/trunk/spec/ruby/.rubocop_todo.yml#L148 - 'core/module/fixtures/classes.rb' - 'core/module/module_function_spec.rb' - 'core/module/private_class_method_spec.rb' - - 'core/module/private_spec.rb' - - 'core/module/protected_spec.rb' - - 'core/module/public_spec.rb' - 'language/fixtures/send.rb' - -# Offense count: 6186 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 588 diff --git a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb b/spec/ruby/core/builtin_constants/builtin_constants_spec.rb index a5141c3..21102be 100644 --- a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb +++ b/spec/ruby/core/builtin_constants/builtin_constants_spec.rb @@ -34,6 +34,12 @@ describe "RUBY_PLATFORM" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/builtin_constants/builtin_constants_spec.rb#L34 it "is a String" do RUBY_PLATFORM.should be_kind_of(String) end + + platform_is :darwin do + it 'ends with the build time kernel major version on darwin' do + RUBY_PLATFORM.should =~ /-darwin\d+$/ + end + end end describe "RUBY_RELEASE_DATE" do diff --git a/spec/ruby/core/exception/errno_spec.rb b/spec/ruby/core/exception/errno_spec.rb index 9e0bf00..e76b293 100644 --- a/spec/ruby/core/exception/errno_spec.rb +++ b/spec/ruby/core/exception/errno_spec.rb @@ -1,10 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/errno_spec.rb#L1 require_relative '../../spec_helper' require_relative 'fixtures/common' -describe "SystemCallError#errno" do - it "needs to be reviewed for spec completeness" -end - describe "Errno::EINVAL.new" do it "can be called with no arguments" do exc = Errno::EINVAL.new diff --git a/spec/ruby/core/exception/exit_value_spec.rb b/spec/ruby/core/exception/exit_value_spec.rb index 43de56a..8bb3cf8 100644 --- a/spec/ruby/core/exception/exit_value_spec.rb +++ b/spec/ruby/core/exception/exit_value_spec.rb @@ -1,5 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/exit_value_spec.rb#L1 require_relative '../../spec_helper' describe "LocalJumpError#exit_value" do - it "needs to be reviewed for spec completeness" + def get_me_a_return + Proc.new { return 42 } + end + -> { get_me_a_return.call }.should raise_error(LocalJumpError) { |e| + e.exit_value.should == 42 + } end diff --git a/spec/ruby/core/exception/frozen_error_spec.rb b/spec/ruby/core/exception/frozen_error_spec.rb index 1b5ea71..f27b332 100644 --- a/spec/ruby/core/exception/frozen_error_spec.rb +++ b/spec/ruby/core/exception/frozen_error_spec.rb @@ -1,13 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/frozen_error_spec.rb#L1 require_relative '../../spec_helper' -describe "FrozenError" do - ruby_version_is "2.5" do - it "is a subclass of RuntimeError" do - RuntimeError.should be_ancestor_of(FrozenError) - end - end -end - describe "FrozenError.new" do ruby_version_is "2.7" do it "should take optional receiver argument" do diff --git a/spec/ruby/core/exception/incomplete_input_spec.rb b/spec/ruby/core/exception/incomplete_input_spec.rb index b033b33..930a3f0 100644 --- a/spec/ruby/core/exception/incomplete_input_spec.rb +++ b/spec/ruby/core/exception/incomplete_input_spec.rb @@ -1,5 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/incomplete_input_spec.rb#L1 require_relative '../../spec_helper' describe "Encoding::InvalidByteSequenceError#incomplete_input?" do - it "needs to be reviewed for spec completeness" + -> {"abc\xa4def".encode("ISO-8859-1", "EUC-JP") }.should raise_error(Encoding::InvalidByteSequenceError) { |e| + e.incomplete_input?.should == false + } end diff --git a/spec/ruby/core/exception/io_error_spec.rb b/spec/ruby/core/exception/io_error_spec.rb index 8dc10cc..ab8a725 100644 --- a/spec/ruby/core/exception/io_error_spec.rb +++ b/spec/ruby/core/exception/io_error_spec.rb @@ -1,11 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/io_error_spec.rb#L1 require_relative '../../spec_helper' -describe "IOError" do - it "is a superclass of EOFError" do - IOError.should be_ancestor_of(EOFError) - end -end - describe "IO::EAGAINWaitReadable" do it "combines Errno::EAGAIN and IO::WaitReadable" do IO::EAGAINWaitReadable.superclass.should == Errno::EAGAIN diff --git a/spec/ruby/core/exception/name_error_spec.rb b/spec/ruby/core/exception/name_error_spec.rb index d0a8100..e901a80 100644 --- a/spec/ruby/core/exception/name_error_spec.rb +++ b/spec/ruby/core/exception/name_error_spec.rb @@ -1,11 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/exception/name_ (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/