1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-03-04 15:09:32 +00:00
parent 8a15857a7f
commit 401b64c4e8
3689 changed files with 6095 additions and 6096 deletions

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The BEGIN keyword" do
before :each do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
class AliasObject
attr :foo

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The '&&' statement" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/array', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/array'
describe "Array literals" do
it "[] should return a new array populated with the given elements" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/block', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/block'
describe "A block yielded a single" do
before :all do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/break', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/break'
describe "The break statement in a block" do
before :each do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The 'case'-construct" do
it "evaluates the body of the when clause matching the case target expression" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/class', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/class'
ClassSpecsNumber = 12

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/class_variables', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/class_variables'
describe "A class variable" do
after :each do

View file

@ -1,7 +1,7 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/constants', __FILE__)
require File.expand_path('../fixtures/constants_sclass', __FILE__)
require File.expand_path('../fixtures/constant_visibility', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/constants'
require_relative 'fixtures/constants_sclass'
require_relative 'fixtures/constant_visibility'
# Read the documentation in fixtures/constants.rb for the guidelines and
# rationale for the structure and organization of these specs.

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/def', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/def'
# Language-level method behaviour
describe "Redefining a method" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/defined', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/defined'
describe "The defined? keyword for literals" do
it "returns 'self' for self" do
@ -763,8 +763,10 @@ describe "The defined? keyword for a scoped constant" do
end
ruby_version_is "2.5" do
it "returns nil when a constant is defined on top-level but not on the class" do
defined?(DefinedSpecs::Basic::String).should be_nil
ruby_bug "#14407", "2.5.0"..."2.5.1" do
it "returns nil when a constant is defined on top-level but not on the class" do
defined?(DefinedSpecs::Basic::String).should be_nil
end
end
end

View file

@ -1,7 +1,7 @@
# -*- encoding: us-ascii -*-
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/coding_us_ascii', __FILE__)
require File.expand_path('../fixtures/coding_utf_8', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/coding_us_ascii'
require_relative 'fixtures/coding_utf_8'
describe "The __ENCODING__ pseudo-variable" do
it "is an instance of Encoding" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/ensure', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/ensure'
describe "An ensure block inside a begin block" do
before :each do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "``" do
it "returns the output of the executed sub-process" do

View file

@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/code_loading', __FILE__)
require File.expand_path('../shared/__FILE__', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/code_loading'
require_relative 'shared/__FILE__'
describe "The __FILE__ pseudo-variable" do
it "raises a SyntaxError if assigned to" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
# for name[, name]... in expr [do]
# body

View file

@ -1,7 +1,7 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/hash_strings_ascii8bit', __FILE__)
require File.expand_path('../fixtures/hash_strings_utf8', __FILE__)
require File.expand_path('../fixtures/hash_strings_usascii', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/hash_strings_ascii8bit'
require_relative 'fixtures/hash_strings_utf8'
require_relative 'fixtures/hash_strings_usascii'
describe "Hash literal" do
it "{} should return an empty hash" do

View file

@ -1,6 +1,6 @@
# -*- encoding: us-ascii -*-
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "Heredoc string" do
@ -55,32 +55,32 @@ HERE
ruby_version_is "2.3" do
it "allows HEREDOC with <<~'identifier', allowing to indent identifier and content" do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.message.should == "character density, n.:\n The number of very weird people in the office.\n"
end
it "trims trailing newline character for blank HEREDOC with <<~'identifier'" do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.blank.should == ""
end
it 'allows HEREDOC with <<~identifier, interpolated' do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.unquoted.should == "unquoted interpolated\n"
end
it 'allows HEREDOC with <<~"identifier", interpolated' do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.doublequoted.should == "doublequoted interpolated\n"
end
it "allows HEREDOC with <<~'identifier', no interpolation" do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.singlequoted.should == "singlequoted \#{\"interpolated\"}\n"
end
it "selects the least-indented line and removes its indentation from all the lines" do
require File.expand_path('../fixtures/squiggly_heredoc', __FILE__)
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.least_indented_on_the_last_line.should == " a\n b\nc\n"
end
end

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The if expression" do
ruby_version_is '2.4' do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/classes'
describe "A lambda literal -> () { }" do
SpecEvaluate.desc = "for definition"

View file

@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/code_loading', __FILE__)
require File.expand_path('../shared/__LINE__', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/code_loading'
require_relative 'shared/__LINE__'
describe "The __LINE__ pseudo-variable" do
it "raises a SyntaxError if assigned to" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The loop expression" do
it "repeats the given block until a break is called" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "Magic comment" do
it "is optional" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/match_operators', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/match_operators'
describe "The !~ operator" do
before :each do

View file

@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/class', __FILE__)
require File.expand_path('../fixtures/metaclass', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/class'
require_relative 'fixtures/metaclass'
describe "self in a metaclass body (class << obj)" do
it "is TrueClass for true" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "A method send" do
evaluate <<-ruby do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/module', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/module'
describe "The module keyword" do
it "creates a new module without semicolon" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/next', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/next'
describe "The next statement from within the block" do
before :each do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The not keyword" do
it "negates a `true' value" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "A number literal" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe 'Optional variable assignments' do
describe 'using ||=' do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The || operator" do
it "evaluates to true if any of its operands are true" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "A method call" do
before :each do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/precedence', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/precedence'
# Specifying the behavior of operators in combination could
# lead to combinatorial explosion. A better way seems to be
@ -296,15 +296,14 @@ describe "Operators" do
lambda { eval("1...2...3") }.should raise_error(SyntaxError)
end
# XXX: this is commented now due to a bug in compiler, which cannot
# distinguish between range and flip-flop operator so far. zenspider is
# currently working on a new lexer, which will be able to do that.
# As soon as it's done, these piece should be reenabled.
#
# it ".. ... have higher precedence than ? :" do
# (1..2 ? 3 : 4).should == 3
# (1...2 ? 3 : 4).should == 3
# end
it ".. ... have higher precedence than ? :" do
# Use variables to avoid warnings
from = 1
to = 2
# These are Range instances, not flip-flop
(from..to ? 3 : 4).should == 3
(from...to ? 3 : 4).should == 3
end
it "? : is right-associative" do
(true ? 2 : 3 ? 4 : 5).should == 2

View file

@ -1,4 +1,4 @@
require File.expand_path('../../../spec_helper', __FILE__)
require_relative '../../spec_helper'
describe "The DATA constant" do
it "exists when the main script contains __END__" do

View file

@ -1,4 +1,3 @@
require File.expand_path("../data4.rb", __FILE__)
require_relative 'data4'
p Object.const_defined?(:DATA)

View file

@ -1,5 +1,4 @@
require File.expand_path("../data4.rb", __FILE__)
require_relative 'data4'
puts DATA.read

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
require 'stringio'
# The following tables are excerpted from Programming Ruby: The Pragmatic Programmer's Guide'

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/private', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/private'
describe "The private keyword" do
it "marks following methods as being private" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "A Proc" do
it "captures locals from the surrounding scope" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The redo statement" do
it "restarts block execution if used within block" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with anchors" do
it "supports ^ (line start anchor)" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with back-references" do
it "saves match data in the $~ pseudo-global variable" do

View file

@ -1,6 +1,6 @@
# coding: utf-8
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexp with character classes" do
it "supports \\w (word character)" do

View file

@ -1,6 +1,6 @@
# -*- encoding: binary -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with encoding modifiers" do
it "supports /e (EUC encoding)" do

View file

@ -1,6 +1,6 @@
# -*- encoding: binary -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with escape characters" do
it "they're supported" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with grouping" do
it "support ()" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with interpolation" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with modifers" do
it "supports /i (case-insensitive)" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with repetition" do
it "supports * (0 or more of previous subexpression)" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/classes'
describe "Literal Regexps" do
it "matches against $_ (last input) in a conditional if no explicit matchee provided" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/rescue', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/rescue'
class SpecificExampleException < StandardError
end

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The retry statement" do
it "re-executes the closest block" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/return', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/return'
describe "The return keyword" do
it "returns any object directly" do

View file

@ -1,4 +1,4 @@
require File.expand_path("../../spec_helper", __FILE__)
require_relative '../spec_helper'
ruby_version_is "2.3" do
describe "Safe navigator" do

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/send', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/send'
# Why so many fixed arg tests? JRuby and I assume other Ruby impls have
# separate call paths for simple fixed arity methods. Testing up to five

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/class', __FILE__)
require_relative '../spec_helper'
require_relative '../fixtures/class'
describe "A singleton class" do
it "is TrueClass for true" do

View file

@ -1,6 +1,6 @@
# -*- encoding: binary -*-
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
# TODO: rewrite these horrid specs. it "are..." seriously?!

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/super', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/super'
describe "The super keyword" do
it "calls the method on the calling class" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "A Symbol literal" do
it "is a ':' followed by any number of valid characters" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The throw keyword" do
it "abandons processing" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The undef keyword" do
describe "undefines a method" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
describe "The unless expression" do
it "evaluates the unless body when the expression is false" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
# until bool-expr [do]
# body

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/variables', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/variables'
describe "Multiple assignment" do
context "with a single RHS value" do

View file

@ -1,4 +1,4 @@
require File.expand_path('../../spec_helper', __FILE__)
require_relative '../spec_helper'
# while bool-expr [do]
# body

View file

@ -1,5 +1,5 @@
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/yield', __FILE__)
require_relative '../spec_helper'
require_relative 'fixtures/yield'
# Note that these specs use blocks defined as { |*a| ... } to capture the
# arguments with which the block is invoked. This is slightly confusing