mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Update to ruby/spec@0fe33ac
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									0f989b87a0
								
							
						
					
					
						commit
						a34db218ad
					
				
					 162 changed files with 1267 additions and 621 deletions
				
			
		| 
						 | 
				
			
			@ -36,11 +36,11 @@ describe "Date constants" do
 | 
			
		|||
    [Date::MONTHNAMES, Date::DAYNAMES, Date::ABBR_MONTHNAMES, Date::ABBR_DAYNAMES].each do |ary|
 | 
			
		||||
      lambda {
 | 
			
		||||
        ary << "Unknown"
 | 
			
		||||
      }.should raise_error(RuntimeError, /frozen/)
 | 
			
		||||
      }.should raise_error(frozen_error_class, /frozen/)
 | 
			
		||||
      ary.compact.each do |name|
 | 
			
		||||
        lambda {
 | 
			
		||||
          name << "modified"
 | 
			
		||||
        }.should raise_error(RuntimeError, /frozen/)
 | 
			
		||||
        }.should raise_error(frozen_error_class, /frozen/)
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										9
									
								
								spec/ruby/library/mathn/mathn_spec.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								spec/ruby/library/mathn/mathn_spec.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
require File.expand_path('../../../spec_helper', __FILE__)
 | 
			
		||||
 | 
			
		||||
describe "mathn" do
 | 
			
		||||
  ruby_version_is "2.5" do
 | 
			
		||||
    it "is no longer part of the standard library" do
 | 
			
		||||
      -> { require "mathn" }.should raise_error(LoadError)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -92,11 +92,11 @@ ruby_version_is '2.4' do
 | 
			
		|||
      set.to_a.sort.should == [a1, a2].sort
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "raises a RuntimeError on frozen sets" do
 | 
			
		||||
    it "raises a #{frozen_error_class} on frozen sets" do
 | 
			
		||||
      set = Set.new.freeze
 | 
			
		||||
      lambda {
 | 
			
		||||
        set.compare_by_identity
 | 
			
		||||
      }.should raise_error(RuntimeError, /frozen Hash/)
 | 
			
		||||
      }.should raise_error(frozen_error_class, /frozen Hash/)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "persists over #dups" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,9 +110,9 @@ describe "StringIO#initialize when passed [Object, mode]" do
 | 
			
		|||
    io.closed_write?.should be_false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "raises a RuntimeError when passed a frozen String in truncate mode as StringIO backend" do
 | 
			
		||||
  it "raises a #{frozen_error_class} when passed a frozen String in truncate mode as StringIO backend" do
 | 
			
		||||
    io = StringIO.allocate
 | 
			
		||||
    lambda { io.send(:initialize, "example".freeze, IO::TRUNC) }.should raise_error(RuntimeError)
 | 
			
		||||
    lambda { io.send(:initialize, "example".freeze, IO::TRUNC) }.should raise_error(frozen_error_class)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "tries to convert the passed mode to a String using #to_str" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -134,8 +134,8 @@ describe "StringIO.open when passed [Object, mode]" do
 | 
			
		|||
    io.closed_write?.should be_false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "raises a RuntimeError when passed a frozen String in truncate mode as StringIO backend" do
 | 
			
		||||
    lambda { StringIO.open("example".freeze, IO::TRUNC) }.should raise_error(RuntimeError)
 | 
			
		||||
  it "raises a #{frozen_error_class} when passed a frozen String in truncate mode as StringIO backend" do
 | 
			
		||||
    lambda { StringIO.open("example".freeze, IO::TRUNC) }.should raise_error(frozen_error_class)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "tries to convert the passed mode to a String using #to_str" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,8 +48,8 @@ describe "StringIO#reopen when passed [Object, Integer]" do
 | 
			
		|||
    lambda { @io.reopen("burn".freeze, IO::WRONLY | IO::APPEND) }.should raise_error(Errno::EACCES)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "raises a RuntimeError when trying to reopen self with a frozen String in truncate-mode" do
 | 
			
		||||
    lambda { @io.reopen("burn".freeze, IO::RDONLY | IO::TRUNC) }.should raise_error(RuntimeError)
 | 
			
		||||
  it "raises a #{frozen_error_class} when trying to reopen self with a frozen String in truncate-mode" do
 | 
			
		||||
    lambda { @io.reopen("burn".freeze, IO::RDONLY | IO::TRUNC) }.should raise_error(frozen_error_class)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "does not raise IOError when passed a frozen String in read-mode" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,8 +27,8 @@ describe :stringio_read, shared: true do
 | 
			
		|||
    lambda { @io.send(@method, 7, Object.new) }.should raise_error(TypeError)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "raises an error when passed a frozen String as buffer" do
 | 
			
		||||
    lambda { @io.send(@method, 7, "".freeze) }.should raise_error(RuntimeError)
 | 
			
		||||
  it "raises a #{frozen_error_class} error when passed a frozen String as buffer" do
 | 
			
		||||
    lambda { @io.send(@method, 7, "".freeze) }.should raise_error(frozen_error_class)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,8 +15,7 @@ class WeakRefSpec
 | 
			
		|||
    weak = nil
 | 
			
		||||
    10_000.times do
 | 
			
		||||
      weaks << make_weakref
 | 
			
		||||
      GC.start
 | 
			
		||||
      GC.start
 | 
			
		||||
      10.times { GC.start }
 | 
			
		||||
      break if weak = weaks.find { |w| !w.weakref_alive? }
 | 
			
		||||
    end
 | 
			
		||||
    weak
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,7 +12,7 @@ platform_is :windows do
 | 
			
		|||
    end
 | 
			
		||||
 | 
			
		||||
    it "returns expected value for Scripting Runtime's 'name' method" do
 | 
			
		||||
      pointer_size = RUBY_PLATFORM =~ /\bx64\b/ ? 64 : 1.size * 8
 | 
			
		||||
      pointer_size = PlatformGuard::POINTER_SIZE
 | 
			
		||||
      @m_file_name.offset_vtbl.should == pointer_size
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue