mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@c1b568b
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a15857a7f
commit
401b64c4e8
3689 changed files with 6095 additions and 6096 deletions
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "The BEGIN keyword" do
|
||||
before :each do
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
class AliasObject
|
||||
attr :foo
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "The '&&' statement" do
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
# for name[, name]... in expr [do]
|
||||
# body
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "Magic comment" do
|
||||
it "is optional" do
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "A method send" do
|
||||
evaluate <<-ruby do
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "A number literal" do
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe 'Optional variable assignments' do
|
||||
describe 'using ||=' do
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "A method call" do
|
||||
before :each do
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
require File.expand_path("../data4.rb", __FILE__)
|
||||
require_relative 'data4'
|
||||
|
||||
p Object.const_defined?(:DATA)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
require File.expand_path("../data4.rb", __FILE__)
|
||||
require_relative 'data4'
|
||||
|
||||
puts DATA.read
|
||||
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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?!
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
describe "The throw keyword" do
|
||||
it "abandons processing" do
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
# until bool-expr [do]
|
||||
# body
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../spec_helper', __FILE__)
|
||||
require_relative '../spec_helper'
|
||||
|
||||
# while bool-expr [do]
|
||||
# body
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue