[前][次][番号順一覧][スレッド一覧]

ruby-changes:47090

From: eregon <ko1@a...>
Date: Thu, 29 Jun 2017 23:35:45 +0900 (JST)
Subject: [ruby-changes:47090] eregon:r59205 (trunk): Update to ruby/spec@abf1700

eregon	2017-06-29 23:35:37 +0900 (Thu, 29 Jun 2017)

  New Revision: 59205

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59205

  Log:
    Update to ruby/spec@abf1700

  Added files:
    trunk/spec/rubyspec/.rubocop.yml
    trunk/spec/rubyspec/.rubocop_todo.yml
    trunk/spec/rubyspec/command_line/fixtures/bin/dash_s_fail
    trunk/spec/rubyspec/core/enumerable/sum_spec.rb
    trunk/spec/rubyspec/core/enumerable/uniq_spec.rb
    trunk/spec/rubyspec/core/enumerator/lazy/uniq_spec.rb
    trunk/spec/rubyspec/core/false/falseclass_spec.rb
    trunk/spec/rubyspec/core/kernel/singleton_method_spec.rb
    trunk/spec/rubyspec/core/matchdata/named_captures_spec.rb
    trunk/spec/rubyspec/core/nil/nilclass_spec.rb
    trunk/spec/rubyspec/core/true/trueclass_spec.rb
    trunk/spec/rubyspec/library/zlib/gzipreader/readpartial_spec.rb
    trunk/spec/rubyspec/library/zlib/gzipreader/ungetbyte_spec.rb
  Removed files:
    trunk/spec/rubyspec/core/argf/fixtures/encoding.rb
    trunk/spec/rubyspec/core/process/fixtures/env.rb
    trunk/spec/rubyspec/core/process/fixtures/print.rb
  Modified files:
    trunk/spec/rubyspec/.travis.yml
    trunk/spec/rubyspec/command_line/dash_upper_s_spec.rb
    trunk/spec/rubyspec/core/argf/binmode_spec.rb
    trunk/spec/rubyspec/core/argf/set_encoding_spec.rb
    trunk/spec/rubyspec/core/array/element_set_spec.rb
    trunk/spec/rubyspec/core/array/shared/inspect.rb
    trunk/spec/rubyspec/core/basicobject/equal_spec.rb
    trunk/spec/rubyspec/core/bignum/bignum_spec.rb
    trunk/spec/rubyspec/core/enumerator/inspect_spec.rb
    trunk/spec/rubyspec/core/enumerator/lazy/grep_spec.rb
    trunk/spec/rubyspec/core/enumerator/lazy/grep_v_spec.rb
    trunk/spec/rubyspec/core/fixnum/bit_and_spec.rb
    trunk/spec/rubyspec/core/fixnum/fixnum_spec.rb
    trunk/spec/rubyspec/core/float/float_spec.rb
    trunk/spec/rubyspec/core/float/shared/modulo.rb
    trunk/spec/rubyspec/core/hash/shared/to_s.rb
    trunk/spec/rubyspec/core/io/output_spec.rb
    trunk/spec/rubyspec/core/io/popen_spec.rb
    trunk/spec/rubyspec/core/kernel/autoload_spec.rb
    trunk/spec/rubyspec/core/kernel/caller_spec.rb
    trunk/spec/rubyspec/core/kernel/chomp_spec.rb
    trunk/spec/rubyspec/core/kernel/chop_spec.rb
    trunk/spec/rubyspec/core/kernel/clone_spec.rb
    trunk/spec/rubyspec/core/kernel/fixtures/classes.rb
    trunk/spec/rubyspec/core/kernel/public_method_spec.rb
    trunk/spec/rubyspec/core/marshal/dump_spec.rb
    trunk/spec/rubyspec/core/matchdata/values_at_spec.rb
    trunk/spec/rubyspec/core/module/autoload_spec.rb
    trunk/spec/rubyspec/core/module/module_function_spec.rb
    trunk/spec/rubyspec/core/module/shared/set_visibility.rb
    trunk/spec/rubyspec/core/numeric/shared/step.rb
    trunk/spec/rubyspec/core/process/fixtures/common.rb
    trunk/spec/rubyspec/core/process/kill_spec.rb
    trunk/spec/rubyspec/core/process/spawn_spec.rb
    trunk/spec/rubyspec/core/process/wait_spec.rb
    trunk/spec/rubyspec/core/regexp/encoding_spec.rb
    trunk/spec/rubyspec/core/string/encoding_spec.rb
    trunk/spec/rubyspec/core/symbol/symbol_spec.rb
    trunk/spec/rubyspec/core/time/dup_spec.rb
    trunk/spec/rubyspec/core/time/localtime_spec.rb
    trunk/spec/rubyspec/core/time/shared/gmtime.rb
    trunk/spec/rubyspec/language/predefined_spec.rb
    trunk/spec/rubyspec/library/bigdecimal/gt_spec.rb
    trunk/spec/rubyspec/library/bigdecimal/gte_spec.rb
    trunk/spec/rubyspec/library/bigdecimal/lt_spec.rb
    trunk/spec/rubyspec/library/bigdecimal/lte_spec.rb
    trunk/spec/rubyspec/library/date/shared/jd.rb
    trunk/spec/rubyspec/library/matrix/regular_spec.rb
    trunk/spec/rubyspec/library/matrix/singular_spec.rb
    trunk/spec/rubyspec/library/net/ftp/fixtures/server.rb
    trunk/spec/rubyspec/library/rexml/element/add_attribute_spec.rb
    trunk/spec/rubyspec/library/rexml/text/wrap_spec.rb
    trunk/spec/rubyspec/library/securerandom/random_number_spec.rb
    trunk/spec/rubyspec/library/socket/basicsocket/getsockname_spec.rb
    trunk/spec/rubyspec/library/socket/socket/connect_nonblock_spec.rb
    trunk/spec/rubyspec/library/stringio/printf_spec.rb
    trunk/spec/rubyspec/library/stringscanner/shared/matched_size.rb
    trunk/spec/rubyspec/library/zlib/deflate/params_spec.rb
    trunk/spec/rubyspec/library/zlib/gzipreader/gets_spec.rb
    trunk/spec/rubyspec/library/zlib/gzipreader/ungetc_spec.rb
    trunk/spec/rubyspec/library/zlib/gzipwriter/mtime_spec.rb
    trunk/spec/rubyspec/optional/capi/bignum_spec.rb
    trunk/spec/rubyspec/optional/capi/kernel_spec.rb
Index: spec/rubyspec/core/process/fixtures/env.rb
===================================================================
--- spec/rubyspec/core/process/fixtures/env.rb	(revision 59204)
+++ spec/rubyspec/core/process/fixtures/env.rb	(nonexistent)
@@ -1 +0,0 @@
-File.write ARGV[0], ENV["FOO"]

Property changes on: spec/rubyspec/core/process/fixtures/env.rb
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-LF
\ No newline at end of property
Index: spec/rubyspec/core/process/fixtures/print.rb
===================================================================
--- spec/rubyspec/core/process/fixtures/print.rb	(revision 59204)
+++ spec/rubyspec/core/process/fixtures/print.rb	(nonexistent)
@@ -1 +0,0 @@
-print :glark

Property changes on: spec/rubyspec/core/process/fixtures/print.rb
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-LF
\ No newline at end of property
Index: spec/rubyspec/core/argf/fixtures/encoding.rb
===================================================================
--- spec/rubyspec/core/argf/fixtures/encoding.rb	(revision 59204)
+++ spec/rubyspec/core/argf/fixtures/encoding.rb	(nonexistent)
@@ -1,5 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/argf/fixtures/encoding.rb#L0
-ARGF.binmode
-puts ARGF.binmode?
-puts ARGF.gets.encoding
-ARGF.skip
-puts ARGF.read.encoding

Property changes on: spec/rubyspec/core/argf/fixtures/encoding.rb
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-LF
\ No newline at end of property
Index: spec/rubyspec/core/module/autoload_spec.rb
===================================================================
--- spec/rubyspec/core/module/autoload_spec.rb	(revision 59204)
+++ spec/rubyspec/core/module/autoload_spec.rb	(revision 59205)
@@ -414,7 +414,7 @@ describe "Module#autoload" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/autoload_spec.rb#L414
         mod_names = []
         mod_count.times do |i|
           mod_name = :"Mod#{i}"
-          autoload mod_name, autoload_path
+          Object.autoload mod_name, autoload_path
           mod_names << mod_name
         end
 
Index: spec/rubyspec/core/false/falseclass_spec.rb
===================================================================
--- spec/rubyspec/core/false/falseclass_spec.rb	(nonexistent)
+++ spec/rubyspec/core/false/falseclass_spec.rb	(revision 59205)
@@ -0,0 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/false/falseclass_spec.rb#L1
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "FalseClass" do
+  it ".allocate raises a TypeError" do
+    lambda do
+      FalseClass.allocate
+    end.should raise_error(TypeError)
+  end
+
+  it ".new is undefined" do
+    lambda do
+      FalseClass.new
+    end.should raise_error(NoMethodError)
+  end
+end
Index: spec/rubyspec/core/symbol/symbol_spec.rb
===================================================================
--- spec/rubyspec/core/symbol/symbol_spec.rb	(revision 59204)
+++ spec/rubyspec/core/symbol/symbol_spec.rb	(revision 59205)
@@ -4,4 +4,16 @@ describe "Symbol" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/symbol/symbol_spec.rb#L4
   it "includes Comparable" do
     Symbol.include?(Comparable).should == true
   end
+
+  it ".allocate raises a TypeError" do
+    lambda do
+      Symbol.allocate
+    end.should raise_error(TypeError)
+  end
+
+  it ".new is undefined" do
+    lambda do
+      Symbol.new
+    end.should raise_error(NoMethodError)
+  end
 end
Index: spec/rubyspec/core/string/encoding_spec.rb
===================================================================
--- spec/rubyspec/core/string/encoding_spec.rb	(revision 59204)
+++ spec/rubyspec/core/string/encoding_spec.rb	(revision 59205)
@@ -133,7 +133,7 @@ with_feature :encoding do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/string/encoding_spec.rb#L133
       str += [0xDF].pack('C')
       str.ascii_only?.should be_false
       str.encoding.should == Encoding::ASCII_8BIT
-     end
+    end
 
     # TODO: Deal with case when the byte in question isn't valid in the source
     # encoding?
Index: spec/rubyspec/core/argf/set_encoding_spec.rb
===================================================================
--- spec/rubyspec/core/argf/set_encoding_spec.rb	(revision 59204)
+++ spec/rubyspec/core/argf/set_encoding_spec.rb	(revision 59205)
@@ -1,28 +1,41 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/argf/set_encoding_spec.rb#L1
 require File.expand_path('../../../spec_helper', __FILE__)
 
-# These specs need to be run to a separate process as there is no way to reset ARGF encoding
 describe "ARGF.set_encoding" do
   before :each do
     @file = fixture __FILE__, "file1.txt"
   end
 
   it "sets the external encoding when passed an encoding instance" do
-    enc = ruby_exe('ARGF.set_encoding(Encoding::UTF_8); print ARGF.gets.encoding', args: [@file])
-    enc.should == "UTF-8"
+    argf [@file] do
+      @argf.set_encoding(Encoding::US_ASCII)
+      @argf.external_encoding.should == Encoding::US_ASCII
+      @argf.gets.encoding.should == Encoding::US_ASCII
+    end
   end
 
   it "sets the external encoding when passed an encoding name" do
-    enc = ruby_exe('ARGF.set_encoding("utf-8"); print ARGF.gets.encoding', args: [@file])
-    enc.should == "UTF-8"
+    argf [@file] do
+      @argf.set_encoding("us-ascii")
+      @argf.external_encoding.should == Encoding::US_ASCII
+      @argf.gets.encoding.should == Encoding::US_ASCII
+    end
   end
 
   it "sets the external, internal encoding when passed two encoding instances" do
-    enc = ruby_exe('ARGF.set_encoding(Encoding::UTF_8, Encoding::EUC_JP); print ARGF.gets.encoding', args: [@file])
-    enc.should == "EUC-JP"
+    argf [@file] do
+      @argf.set_encoding(Encoding::US_ASCII, Encoding::EUC_JP)
+      @argf.external_encoding.should == Encoding::US_ASCII
+      @argf.internal_encoding.should == Encoding::EUC_JP
+      @argf.gets.encoding.should == Encoding::EUC_JP
+    end
   end
 
   it "sets the external, internal encoding when passed 'ext:int' String" do
-    enc = ruby_exe('ARGF.set_encoding("utf-8:euc-jp"); print ARGF.gets.encoding', args: [@file])
-    enc.should == "EUC-JP"
+    argf [@file] do
+      @argf.set_encoding("us-ascii:euc-jp")
+      @argf.external_encoding.should == Encoding::US_ASCII
+      @argf.internal_encoding.should == Encoding::EUC_JP
+      @argf.gets.encoding.should == Encoding::EUC_JP
+    end
   end
 end
Index: spec/rubyspec/core/enumerable/uniq_spec.rb
===================================================================
--- spec/rubyspec/core/enumerable/uniq_spec.rb	(nonexistent)
+++ spec/rubyspec/core/enumerable/uniq_spec.rb	(revision 59205)
@@ -0,0 +1,29 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/enumerable/uniq_spec.rb#L1
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+
+ruby_version_is '2.4' do
+  describe 'Enumerable#uniq' do
+    it 'returns an array that contains only unique elements' do
+      [0, 1, 2, 3].to_enum.uniq { |n| n.even? }.should == [0, 1]
+    end
+
+    context 'when yielded with multiple arguments' do
+      before :each do
+        @enum = Object.new.to_enum
+        class << @enum
+          def each
+            yield 0, 'foo'
+            yield 1, 'FOO'
+            yield 2, 'bar'
+          end
+        end
+      end
+
+      ruby_bug '#13669', ''...'2.5' do
+        it 'returns all yield arguments as an array' do
+          @enum.uniq { |_, label| label.downcase }.should == [[0, 'foo'], [2, 'bar']]
+        end
+      end
+    end
+  end
+end
Index: spec/rubyspec/core/enumerator/lazy/grep_spec.rb
===================================================================
--- spec/rubyspec/core/enumerator/lazy/grep_spec.rb	(revision 59204)
+++ spec/rubyspec/core/enumerator/lazy/grep_spec.rb	(revision 59205)
@@ -64,7 +64,7 @@ describe "Enumerator::Lazy#grep" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/enumerator/lazy/grep_spec.rb#L64
     end
 
     describe "when the returned lazy enumerator is evaluated by Enumerable#first" do
-     it "stops after specified times when not given a block" do
+      it "stops after specified times when not given a block" do
         (0..Float::INFINITY).lazy.grep(Integer).grep(Object).first(3).should == [0, 1, 2]
 
         @eventsmixed.grep(BasicObject).grep(Object).first(1)
Index: spec/rubyspec/core/enumerator/lazy/grep_v_spec.rb
===================================================================
--- spec/rubyspec/core/enumerator/lazy/grep_v_spec.rb	(revision 59204)
+++ spec/rubyspec/core/enumerator/lazy/grep_v_spec.rb	(revision 59205)
@@ -63,7 +63,7 @@ ruby_version_is "2.3" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/enumerator/lazy/grep_v_spec.rb#L63
       end
 
       describe "when the returned lazy enumerator is evaluated by Enumerable#first" do
-       it "stops after specified times when not given a block" do
+        it "stops after specified times when not given a block" do
           (0..Float::INFINITY).lazy.grep_v(3..5).grep_v(6..10).first(3).should == [0, 1, 2]
 
           @eventsmixed.grep_v(Symbol).grep_v(String).first(1)
Index: spec/rubyspec/core/module/shared/set_visibility.rb
===================================================================
--- spec/rubyspec/core/module/shared/set_visibility.rb	(revision 59204)
+++ spec/rubyspec/core/module/shared/set_visibility.rb	(revision 59205)
@@ -9,11 +9,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L9
     it "sets visibility to following method definitions" do
       visibility = @method
       mod = Module.new {
-            send visibility
+        send visibility
 
-            def test1() end
-            def test2() end
-          }
+        def test1() end
+        def test2() end
+      }
 
       mod.should send(:"have_#{@method}_instance_method", :test1, false)
       mod.should send(:"have_#{@method}_instance_method", :test2, false)
@@ -23,11 +23,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L23
       visibility = @method
       new_visibility = nil
       mod = Module.new {
-            send visibility
-            new_visibility = [:protected, :private].find {|vis| vis != visibility }
-            send new_visibility
-            def test1() end
-          }
+        send visibility
+        new_visibility = [:protected, :private].find {|vis| vis != visibility }
+        send new_visibility
+        def test1() end
+      }
 
       mod.should send(:"have_#{new_visibility}_instance_method", :test1, false)
     end
@@ -35,11 +35,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L35
     it "continues setting visibility if the body encounters other visibility setters with arguments" do
       visibility = @method
       mod = Module.new {
-            send visibility
-            def test1() end
-            send([:protected, :private].find {|vis| vis != visibility }, :test1)
-            def test2() end
-          }
+        send visibility
+        def test1() end
+        send([:protected, :private].find {|vis| vis != visibility }, :test1)
+        def test2() end
+      }
 
       mod.should send(:"have_#{@method}_instance_method", :test2, false)
     end
@@ -47,11 +47,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L47
     it "does not affect module_evaled method definitions when itself is outside the eval" do
       visibility = @method
       mod = Module.new {
-            send visibility
+        send visibility
 
-            module_eval { def test1() end }
-            module_eval " def test2() end "
-          }
+        module_eval { def test1() end }
+        module_eval " def test2() end "
+      }
 
       mod.should have_public_instance_method(:test1, false)
       mod.should have_public_instance_method(:test2, false)
@@ -60,10 +60,10 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L60
     it "does not affect outside method definitions when itself is inside a module_eval" do
       visibility = @method
       mod = Module.new {
-            module_eval { send visibility }
+        module_eval { send visibility }
 
-            def test1() end
-          }
+        def test1() end
+      }
 
       mod.should have_public_instance_method(:test1, false)
     end
@@ -71,12 +71,12 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L71
     it "affects normally if itself and method definitions are inside a module_eval" do
       visibility = @method
       mod = Module.new {
-            module_eval {
-              send visibility
+        module_eval {
+          send visibility
 
-              def test1() end
-            }
-          }
+          def test1() end
+        }
+      }
 
       mod.should send(:"have_#{@method}_instance_method", :test1, false)
     end
@@ -85,11 +85,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L85
       visibility = @method
       initialized_visibility = [:public, :protected, :private].find {|sym| sym != visibility }
       mod = Module.new {
-            send initialized_visibility
-            eval visibility.to_s
+        send initialized_visibility
+        eval visibility.to_s
 
-            def test1() end
-          }
+        def test1() end
+      }
 
       mod.should send(:"have_#{initialized_visibility}_instance_method", :test1, false)
     end
@@ -97,10 +97,10 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L97
     it "affects evaled method definitions when itself is outside the eval" do
       visibility = @method
       mod = Module.new {
-            send visibility
+        send visibility
 
-            eval "def test1() end"
-          }
+        eval "def test1() end"
+      }
 
       mod.should send(:"have_#{@method}_instance_method", :test1, false)
     end
@@ -108,12 +108,12 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L108
     it "affects normally if itself and following method definitions are inside a eval" do
       visibility = @method
       mod = Module.new {
-            eval <<-CODE
-              #{visibility}
+        eval <<-CODE
+          #{visibility}
 
-              def test1() end
-            CODE
-          }
+          def test1() end
+        CODE
+      }
 
       mod.should send(:"have_#{@method}_instance_method", :test1, false)
     end
@@ -122,11 +122,11 @@ describe :set_visibility, shared: true d https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/module/shared/set_visibility.rb#L122
       it "sets the visibility outside the closure" do
         visibility = @method
         mod = Module.new {
-              1.times {
-                send visibility
-              }
-              def test1() end
-            }
+          1.times {
+            send visibility
+          }
+          def test1() end
+        }
 
         mod.should send(:"have_#{@method}_instance_method", :test1, false)
       end
Index: spec/rubyspec/core/marshal/dump_spec.rb
===================================================================
--- spec/rubyspec/core/marshal/dump_spec.rb	(revision 59204)
+++ spec/rubyspec/core/marshal/dump_spec.rb	(revision 59205)
@@ -415,6 +415,15 @@ describe "Marshal.dump" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/marshal/dump_spec.rb#L415
       load = Marshal.load(dump)
       load.should == (1...2)
     end
+
+    it "dumps a Range with extra instance variables" do
+      range = (1...3)
+      range.instance_variable_set :@foo, 42
+      dump = Marshal.dump(range)
+      load = Marshal.load(dump)
+      load.should == range
+      load.instance_variable_get(:@foo).should == 42
+    end
   end
 
   describe "with a Time" do
Index: spec/rubyspec/core/numeric/shared/step.rb
===================================================================
--- spec/rubyspec/core/numeric/shared/step.rb	(revision 59204)
+++ spec/rubyspec/core/numeric/shared/step.rb	(revision 59205)
@@ -407,6 +407,18 @@ describe :numeric_step, :shared => true https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/numeric/shared/step.rb#L407
             end
           end
         end
+
+        describe "when stop is not passed" do
+          it "returns infinity_value" do
+            1.send(@method, *@step_args.call()).size.should == infinity_value
+          end
+        end
+
+        describe "when stop is nil" do
+          it "returns infinity_value" do
+            1.send(@method, *@step_args.call(nil, 5)).size.should == infinity_value
+          end
+        end
       end
     end
   end
Index: spec/rubyspec/core/fixnum/bit_and_spec.rb
===================================================================
--- spec/rubyspec/core/fixnum/bit_and_spec.rb	(revision 59204)
+++ spec/rubyspec/core/fixnum/bit_and_spec.rb	(revision 59205)
@@ -27,6 +27,12 @@ describe "Fixnum#&" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/fixnum/bit_and_spec.rb#L27
     (-1 & 2**64).should == 18446744073709551616
   end
 
+  it "coerces the rhs and calls #coerce" do
+    obj = mock("fixnum bit and")
+    obj.should_receive(:coerce).with(6).and_return([3, 6])
+    (6 & obj).should == 2
+  end
+
   it "raises a TypeError when passed a Float" do
     lambda { (3 & 3.4) }.should raise_error(TypeError)
   end
Index: spec/rubyspec/.rubocop_todo.yml
===================================================================
--- spec/rubyspec/.rubocop_todo.yml	(nonexistent)
+++ spec/rubyspec/.rubocop_todo.yml	(revision 59205)
@@ -0,0 +1,211 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/.rubocop_todo.yml#L1
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2017-06-18 19:12:38 +0200 using RuboCop version 0.49.1.
+# 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
+# versions of RuboCop, may require this file to be generated again.
+
+# Offense count: 6
+Lint/AmbiguousBlockAssociation:
+  Exclude:
+    - 'core/kernel/trace_var_spec.rb'
+    - 'language/fixtures/argv_encoding.rb'
+    - 'language/fixtures/break.rb'
+    - 'shared/process/abort.rb'
+
+# Offense count: 3
+Lint/CircularArgumentReference:
+  Exclude:
+    - 'language/block_spec.rb'
+    - 'language/def_spec.rb'
+    - 'language/lambda_spec.rb'
+
+# Offense count: 2
+Lint/DuplicateCaseCondition:
+  Exclude:
+    - 'language/case_spec.rb'
+
+# Offense count: 6
+Lint/DuplicateMethods:
+  Exclude:
+    - 'core/array/fixtures/encoded_strings.rb'
+    - 'core/method/fixtures/classes.rb'
+    - 'core/module/fixtures/classes.rb'
+    - 'core/unboundmethod/fixtures/classes.rb'
+    - 'fixtures/class.rb'
+
+# Offense count: 4
+Lint/EmptyWhen:
+  Exclude:
+    - 'language/case_spec.rb'
+
+# Offense count: 5
+Lint/EnsureReturn:
+  Exclude:
+    - 'language/fixtures/ensure.rb'
+    - 'language/fixtures/return.rb'
+    - 'language/return_spec.rb'
+
+# Offense count: 10
+Lint/FloatOutOfRange:
+  Exclude:
+    - 'core/string/modulo_spec.rb'
+
+# Offense count: 46
+Lint/FormatParameterMisma (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]