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

ruby-changes:53823

From: eregon <ko1@a...>
Date: Wed, 28 Nov 2018 05:39:04 +0900 (JST)
Subject: [ruby-changes:53823] eregon:r66041 (trunk): Update to ruby/spec@cdd6ff7

eregon	2018-11-28 05:38:57 +0900 (Wed, 28 Nov 2018)

  New Revision: 66041

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

  Log:
    Update to ruby/spec@cdd6ff7

  Added directories:
    trunk/spec/ruby/core/queue/
    trunk/spec/ruby/core/sizedqueue/
    trunk/spec/ruby/shared/queue/
    trunk/spec/ruby/shared/sizedqueue/
  Added files:
    trunk/spec/ruby/core/process/clock_gettime_spec.rb
    trunk/spec/ruby/core/queue/append_spec.rb
    trunk/spec/ruby/core/queue/clear_spec.rb
    trunk/spec/ruby/core/queue/close_spec.rb
    trunk/spec/ruby/core/queue/closed_spec.rb
    trunk/spec/ruby/core/queue/deq_spec.rb
    trunk/spec/ruby/core/queue/empty_spec.rb
    trunk/spec/ruby/core/queue/enq_spec.rb
    trunk/spec/ruby/core/queue/length_spec.rb
    trunk/spec/ruby/core/queue/num_waiting_spec.rb
    trunk/spec/ruby/core/queue/pop_spec.rb
    trunk/spec/ruby/core/queue/push_spec.rb
    trunk/spec/ruby/core/queue/shift_spec.rb
    trunk/spec/ruby/core/queue/size_spec.rb
    trunk/spec/ruby/core/sizedqueue/append_spec.rb
    trunk/spec/ruby/core/sizedqueue/clear_spec.rb
    trunk/spec/ruby/core/sizedqueue/close_spec.rb
    trunk/spec/ruby/core/sizedqueue/closed_spec.rb
    trunk/spec/ruby/core/sizedqueue/deq_spec.rb
    trunk/spec/ruby/core/sizedqueue/empty_spec.rb
    trunk/spec/ruby/core/sizedqueue/enq_spec.rb
    trunk/spec/ruby/core/sizedqueue/length_spec.rb
    trunk/spec/ruby/core/sizedqueue/max_spec.rb
    trunk/spec/ruby/core/sizedqueue/new_spec.rb
    trunk/spec/ruby/core/sizedqueue/num_waiting_spec.rb
    trunk/spec/ruby/core/sizedqueue/pop_spec.rb
    trunk/spec/ruby/core/sizedqueue/push_spec.rb
    trunk/spec/ruby/core/sizedqueue/shift_spec.rb
    trunk/spec/ruby/core/sizedqueue/size_spec.rb
    trunk/spec/ruby/library/thread/queue_spec.rb
    trunk/spec/ruby/library/thread/sizedqueue_spec.rb
    trunk/spec/ruby/shared/queue/clear.rb
    trunk/spec/ruby/shared/queue/close.rb
    trunk/spec/ruby/shared/queue/closed.rb
    trunk/spec/ruby/shared/queue/deque.rb
    trunk/spec/ruby/shared/queue/empty.rb
    trunk/spec/ruby/shared/queue/enque.rb
    trunk/spec/ruby/shared/queue/length.rb
    trunk/spec/ruby/shared/queue/num_waiting.rb
    trunk/spec/ruby/shared/sizedqueue/enque.rb
    trunk/spec/ruby/shared/sizedqueue/max.rb
    trunk/spec/ruby/shared/sizedqueue/new.rb
    trunk/spec/ruby/shared/sizedqueue/num_waiting.rb
  Removed directories:
    trunk/spec/ruby/library/thread/queue/
    trunk/spec/ruby/library/thread/shared/
    trunk/spec/ruby/library/thread/sizedqueue/
  Removed files:
    trunk/spec/ruby/library/thread/exclusive_spec.rb
  Modified files:
    trunk/spec/ruby/README.md
    trunk/spec/ruby/appveyor.yml
    trunk/spec/ruby/core/dir/home_spec.rb
    trunk/spec/ruby/core/file/expand_path_spec.rb
    trunk/spec/ruby/core/gc/count_spec.rb
    trunk/spec/ruby/core/hash/shift_spec.rb
    trunk/spec/ruby/core/integer/gcd_spec.rb
    trunk/spec/ruby/core/io/syswrite_spec.rb
    trunk/spec/ruby/core/io/ungetbyte_spec.rb
    trunk/spec/ruby/core/main/using_spec.rb
    trunk/spec/ruby/core/module/refine_spec.rb
    trunk/spec/ruby/core/mutex/lock_spec.rb
    trunk/spec/ruby/core/mutex/synchronize_spec.rb
    trunk/spec/ruby/core/signal/list_spec.rb
    trunk/spec/ruby/core/struct/new_spec.rb
    trunk/spec/ruby/core/thread/exclusive_spec.rb
    trunk/spec/ruby/core/thread/raise_spec.rb
    trunk/spec/ruby/core/time/nsec_spec.rb
    trunk/spec/ruby/core/time/shared/time_params.rb
    trunk/spec/ruby/core/time/usec_spec.rb
    trunk/spec/ruby/core/warning/warn_spec.rb
    trunk/spec/ruby/language/def_spec.rb
    trunk/spec/ruby/language/method_spec.rb
    trunk/spec/ruby/library/erb/new_spec.rb
    trunk/spec/ruby/library/set/initialize_spec.rb
    trunk/spec/ruby/library/socket/socket/connect_nonblock_spec.rb
    trunk/spec/ruby/library/tempfile/open_spec.rb
    trunk/spec/ruby/library/win32ole/win32ole/new_spec.rb
    trunk/spec/ruby/shared/kernel/raise.rb
Index: spec/ruby/core/dir/home_spec.rb
===================================================================
--- spec/ruby/core/dir/home_spec.rb	(revision 66040)
+++ spec/ruby/core/dir/home_spec.rb	(revision 66041)
@@ -15,8 +15,8 @@ describe "Dir.home" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/home_spec.rb#L15
   end
 
   platform_is_not :windows do
-    it "returns the named user's home directory as a string if called with an argument" do
-      Dir.home(ENV['USER']).should == ENV['HOME']
+    it "returns the named user's home directory, from the user database, as a string if called with an argument" do
+      Dir.home(ENV['USER']).should == `echo ~#{ENV['USER']}`.chomp
     end
   end
 
Index: spec/ruby/core/queue/closed_spec.rb
===================================================================
--- spec/ruby/core/queue/closed_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/closed_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/closed_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/closed'
+
+describe "Queue#closed?" do
+  it_behaves_like :queue_closed?, :closed?, -> { Queue.new }
+end
Index: spec/ruby/core/queue/size_spec.rb
===================================================================
--- spec/ruby/core/queue/size_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/size_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/size_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/length'
+
+describe "Queue#size" do
+  it_behaves_like :queue_length, :size, -> { Queue.new }
+end
Index: spec/ruby/core/queue/empty_spec.rb
===================================================================
--- spec/ruby/core/queue/empty_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/empty_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/empty_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/empty'
+
+describe "Queue#empty?" do
+  it_behaves_like :queue_empty?, :empty?, -> { Queue.new }
+end
Index: spec/ruby/core/queue/push_spec.rb
===================================================================
--- spec/ruby/core/queue/push_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/push_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/push_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/enque'
+
+describe "Queue#push" do
+  it_behaves_like :queue_enq, :push, -> { Queue.new }
+end
Index: spec/ruby/core/queue/enq_spec.rb
===================================================================
--- spec/ruby/core/queue/enq_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/enq_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/enq_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/enque'
+
+describe "Queue#enq" do
+  it_behaves_like :queue_enq, :enq, -> { Queue.new }
+end
Index: spec/ruby/core/queue/append_spec.rb
===================================================================
--- spec/ruby/core/queue/append_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/append_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/append_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/enque'
+
+describe "Queue#<<" do
+  it_behaves_like :queue_enq, :<<, -> { Queue.new }
+end
Index: spec/ruby/core/time/nsec_spec.rb
===================================================================
--- spec/ruby/core/time/nsec_spec.rb	(revision 66040)
+++ spec/ruby/core/time/nsec_spec.rb	(revision 66041)
@@ -24,4 +24,8 @@ describe "Time#nsec" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/time/nsec_spec.rb#L24
   it "returns the nanoseconds part of a Time constructed with an Rational number of microseconds" do
     Time.at(0, Rational(99, 10)).nsec.should == 9900
   end
+
+  it "returns a positive value for dates before the epoch" do
+    Time.utc(1969, 11, 12, 13, 18, 57, 404240).nsec.should == 404240000
+  end
 end
Index: spec/ruby/core/mutex/synchronize_spec.rb
===================================================================
--- spec/ruby/core/mutex/synchronize_spec.rb	(revision 66040)
+++ spec/ruby/core/mutex/synchronize_spec.rb	(revision 66041)
@@ -24,4 +24,43 @@ describe "Mutex#synchronize" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/mutex/synchronize_spec.rb#L24
     th.join
     m1.locked?.should be_false
   end
+
+  it "blocks the caller if already locked" do
+    m = Mutex.new
+    m.lock
+    lambda { m.synchronize { } }.should block_caller
+  end
+
+  it "does not block the caller if not locked" do
+    m = Mutex.new
+    lambda { m.synchronize { } }.should_not block_caller
+  end
+
+  it "blocks the caller if another thread is also in the synchronize block" do
+    m = Mutex.new
+    q1 = Queue.new
+    q2 = Queue.new
+
+    t = Thread.new {
+      m.synchronize {
+        q1.push :ready
+        q2.pop
+      }
+    }
+
+    q1.pop.should == :ready
+
+    lambda { m.synchronize { } }.should block_caller
+
+    q2.push :done
+    t.join
+  end
+
+  it "is not recursive" do
+    m = Mutex.new
+
+    m.synchronize do
+      lambda { m.synchronize { } }.should raise_error(ThreadError)
+    end
+  end
 end
Index: spec/ruby/core/queue/length_spec.rb
===================================================================
--- spec/ruby/core/queue/length_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/length_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/length_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/length'
+
+describe "Queue#length" do
+  it_behaves_like :queue_length, :length, -> { Queue.new }
+end
Index: spec/ruby/core/queue/close_spec.rb
===================================================================
--- spec/ruby/core/queue/close_spec.rb	(nonexistent)
+++ spec/ruby/core/queue/close_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/queue/close_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/close'
+
+describe "Queue#close" do
+  it_behaves_like :queue_close, :close, -> { Queue.new }
+end
Index: spec/ruby/core/integer/gcd_spec.rb
===================================================================
--- spec/ruby/core/integer/gcd_spec.rb	(revision 66040)
+++ spec/ruby/core/integer/gcd_spec.rb	(revision 66041)
@@ -43,6 +43,17 @@ describe "Integer#gcd" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/gcd_spec.rb#L43
     bignum.gcd(99).should == 99
   end
 
+  it "doesn't cause an integer overflow" do
+    [2 ** (1.size * 8 - 2), 0x8000000000000000].each do |max|
+      [max - 1, max, max + 1].each do |num|
+        num.gcd(num).should == num
+        (-num).gcd(num).should == num
+        (-num).gcd(-num).should == num
+        num.gcd(-num).should == num
+      end
+    end
+  end
+
   it "raises an ArgumentError if not given an argument" do
     lambda { 12.gcd }.should raise_error(ArgumentError)
   end
Index: spec/ruby/core/time/usec_spec.rb
===================================================================
--- spec/ruby/core/time/usec_spec.rb	(revision 66040)
+++ spec/ruby/core/time/usec_spec.rb	(revision 66041)
@@ -36,4 +36,8 @@ describe "Time#usec" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/time/usec_spec.rb#L36
   it "returns the microseconds for time created by Time#local" do
     Time.local(1,2,3,4,5,Rational(6.78)).usec.should == 780000
   end
+
+  it "returns a positive value for dates before the epoch" do
+    Time.utc(1969, 11, 12, 13, 18, 57, 404240).usec.should == 404240
+  end
 end
Index: spec/ruby/core/thread/exclusive_spec.rb
===================================================================
--- spec/ruby/core/thread/exclusive_spec.rb	(revision 66040)
+++ spec/ruby/core/thread/exclusive_spec.rb	(revision 66041)
@@ -14,5 +14,29 @@ describe "Thread.exclusive" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/thread/exclusive_spec.rb#L14
     Thread.exclusive { :result }.should == :result
   end
 
-  it "needs to be reviewed for spec completeness"
+  it "blocks the caller if another thread is also in an exclusive block" do
+    m = Mutex.new
+    q1 = Queue.new
+    q2 = Queue.new
+
+    t = Thread.new {
+      Thread.exclusive {
+        q1.push :ready
+        q2.pop
+      }
+    }
+
+    q1.pop.should == :ready
+
+    lambda { Thread.exclusive { } }.should block_caller
+
+    q2.push :done
+    t.join
+  end
+
+  it "is not recursive" do
+    Thread.exclusive do
+      lambda { Thread.exclusive { } }.should raise_error(ThreadError)
+    end
+  end
 end
Index: spec/ruby/core/signal/list_spec.rb
===================================================================
--- spec/ruby/core/signal/list_spec.rb	(revision 66040)
+++ spec/ruby/core/signal/list_spec.rb	(revision 66041)
@@ -61,4 +61,8 @@ describe "Signal.list" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/signal/list_spec.rb#L61
   it "includes the EXIT key with a value of zero" do
     Signal.list["EXIT"].should == 0
   end
+
+  it "includes the KILL key with a value of nine" do
+    Signal.list["KILL"].should == 9
+  end
 end
Index: spec/ruby/core/process/clock_gettime_spec.rb
===================================================================
--- spec/ruby/core/process/clock_gettime_spec.rb	(nonexistent)
+++ spec/ruby/core/process/clock_gettime_spec.rb	(revision 66041)
@@ -0,0 +1,35 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/clock_gettime_spec.rb#L1
+require_relative '../../spec_helper'
+
+describe "Process.clock_gettime" do
+  describe 'time units' do
+    it 'handles a fixed set of time units' do
+      [:nanosecond, :microsecond, :millisecond, :second].each do |unit|
+        Process.clock_gettime(Process::CLOCK_MONOTONIC, unit).should be_kind_of(Integer)
+      end
+
+      [:float_microsecond, :float_millisecond, :float_second].each do |unit|
+        Process.clock_gettime(Process::CLOCK_MONOTONIC, unit).should be_an_instance_of(Float)
+      end
+    end
+
+    it 'raises an ArgumentError for an invalid time unit' do
+      lambda { Process.clock_gettime(Process::CLOCK_MONOTONIC, :bad) }.should raise_error(ArgumentError)
+    end
+
+    it 'defaults to :float_second' do
+      t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+      t2 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
+
+      t1.should be_an_instance_of(Float)
+      t2.should be_close(t1, 2.0)  # 2.0 is chosen arbitrarily to allow for time skew without admitting failure cases, which would be off by an order of magnitude.
+    end
+
+    it 'uses the default time unit (:float_second) when passed nil' do
+      t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC, nil)
+      t2 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
+
+      t1.should be_an_instance_of(Float)
+      t2.should be_close(t1, 2.0) # 2.0 is chosen arbitrarily to allow for time skew without admitting failure cases, which would be off by an order of magnitude.
+    end
+  end
+end
Index: spec/ruby/core/file/expand_path_spec.rb
===================================================================
--- spec/ruby/core/file/expand_path_spec.rb	(revision 66040)
+++ spec/ruby/core/file/expand_path_spec.rb	(revision 66041)
@@ -88,7 +88,8 @@ describe "File.expand_path" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/expand_path_spec.rb#L88
 
   platform_is_not :windows do
     before do
-      @home = ENV['HOME'].chomp('/')
+      @var_home = ENV['HOME'].chomp('/')
+      @db_home = `echo ~#{ENV['USER']}`.chomp
     end
 
     # FIXME: these are insane!
@@ -107,9 +108,9 @@ describe "File.expand_path" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/expand_path_spec.rb#L108
       File.expand_path('./////').should == Dir.pwd
       File.expand_path('.').should == Dir.pwd
       File.expand_path(Dir.pwd).should == Dir.pwd
-      File.expand_path('~/').should == @home
-      File.expand_path('~/..badfilename').should == "#{@home}/..badfilename"
-      File.expand_path('~/a','~/b').should == "#{@home}/a"
+      File.expand_path('~/').should == @var_home
+      File.expand_path('~/..badfilename').should == "#{@var_home}/..badfilename"
+      File.expand_path('~/a','~/b').should == "#{@var_home}/a"
       File.expand_path('..').should == File.dirname(Dir.pwd)
     end
 
@@ -126,8 +127,11 @@ describe "File.expand_path" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/expand_path_spec.rb#L127
     end
 
     it "expands ~ENV['USER'] to the user's home directory" do
-      File.expand_path("~#{ENV['USER']}").should == @home
-      File.expand_path("~#{ENV['USER']}/a").should == "#{@home}/a"
+      File.expand_path("~#{ENV['USER']}").should == @db_home
+    end
+
+    it "expands ~ENV['USER']/a to a in the user's home directory" do
+      File.expand_path("~#{ENV['USER']}/a").should == "#{@db_home}/a"
     end
 
     it "does not expand ~ENV['USER'] when it's not at the start" do
@@ -135,7 +139,7 @@ describe "File.expand_path" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/expand_path_spec.rb#L139
     end
 
     it "expands ../foo with ~/dir as base dir to /path/to/user/home/foo" do
-      File.expand_path('../foo', '~/dir').should == "#{@home}/foo"
+      File.expand_path('../foo', '~/dir').should == "#{@var_home}/foo"
     end
   end
 
@@ -239,4 +243,19 @@ platform_is_not :windows do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/file/expand_path_spec.rb#L243
       lambda { File.expand_path("~") }.should raise_error(ArgumentError)
     end
   end
+
+  describe "File.expand_path with a non-absolute HOME" do
+    before :each do
+      @home = ENV["HOME"]
+    end
+
+    after :each do
+      ENV["HOME"] = @home
+    end
+
+    it "raises an ArgumentError" do
+      ENV["HOME"] = "non-absolute"
+      lambda { File.expand_path("~") }.should raise_error(ArgumentError, 'non-absolute home')
+    end
+  end
 end
Index: spec/ruby/core/sizedqueue/shift_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/shift_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/shift_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/shift_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/deque'
+
+describe "SizedQueue#shift" do
+  it_behaves_like :queue_deq, :shift, -> { SizedQueue.new(10) }
+end
Index: spec/ruby/core/sizedqueue/empty_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/empty_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/empty_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/empty_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/empty'
+
+describe "SizedQueue#empty?" do
+  it_behaves_like :queue_empty?, :empty?, -> { SizedQueue.new(10) }
+end
Index: spec/ruby/core/sizedqueue/pop_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/pop_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/pop_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/pop_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/deque'
+
+describe "SizedQueue#pop" do
+  it_behaves_like :queue_deq, :pop, -> { SizedQueue.new(10) }
+end
Index: spec/ruby/core/sizedqueue/push_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/push_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/push_spec.rb	(revision 66041)
@@ -0,0 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/push_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/enque'
+require_relative '../../shared/sizedqueue/enque'
+
+describe "SizedQueue#push" do
+  it_behaves_like :queue_enq, :push, -> { SizedQueue.new(10) }
+end
+
+describe "SizedQueue#push" do
+  it_behaves_like :sizedqueue_enq, :push, ->(n) { SizedQueue.new(n) }
+end
Index: spec/ruby/core/sizedqueue/length_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/length_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/length_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/length_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/length'
+
+describe "SizedQueue#length" do
+  it_behaves_like :queue_length, :length, -> { SizedQueue.new(10) }
+end
Index: spec/ruby/core/sizedqueue/num_waiting_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/num_waiting_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/num_waiting_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/num_waiting_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/sizedqueue/num_waiting'
+
+describe "SizedQueue#num_waiting" do
+  it_behaves_like :sizedqueue_num_waiting, :new, ->(n) { SizedQueue.new(n) }
+end
Index: spec/ruby/core/sizedqueue/enq_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/enq_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/enq_spec.rb	(revision 66041)
@@ -0,0 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/enq_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/enque'
+require_relative '../../shared/sizedqueue/enque'
+
+describe "SizedQueue#enq" do
+  it_behaves_like :queue_enq, :enq, -> { SizedQueue.new(10) }
+end
+
+describe "SizedQueue#enq" do
+  it_behaves_like :sizedqueue_enq, :enq, ->(n) { SizedQueue.new(n) }
+end
Index: spec/ruby/core/sizedqueue/close_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/close_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/close_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/close_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/queue/close'
+
+describe "SizedQueue#close" do
+  it_behaves_like :queue_close, :close, -> { SizedQueue.new(10) }
+end

Property changes on: spec/ruby/core/sizedqueue/close_spec.rb
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Index: spec/ruby/core/sizedqueue/max_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/max_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/max_spec.rb	(revision 66041)
@@ -0,0 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedqueue/max_spec.rb#L1
+require_relative '../../spec_helper'
+require_relative '../../shared/sizedqueue/max'
+
+describe "SizedQueue#max" do
+  it_behaves_like :sizedqueue_max, :max, ->(n) { SizedQueue.new(n) }
+end
+
+describe "SizedQueue#max=" do
+  it_behaves_like :sizedqueue_max=, :max=, ->(n) { SizedQueue.new(n) }
+end
Index: spec/ruby/core/sizedqueue/clear_spec.rb
===================================================================
--- spec/ruby/core/sizedqueue/clear_spec.rb	(nonexistent)
+++ spec/ruby/core/sizedqueue/clear_spec.rb	(revision 66041)
@@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/sizedque (... truncated)

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

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