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 "String.allocate" do
|
||||
it "returns an instance of String" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/concat', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/concat'
|
||||
|
||||
describe "String#<<" do
|
||||
it_behaves_like :string_concat, :<<
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#ascii_only?" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#b" do
|
||||
with_feature :encoding do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#bytes" do
|
||||
before :each do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "#String#bytesize" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: binary -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/slice.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/slice'
|
||||
|
||||
describe "String#byteslice" do
|
||||
it "needs to reviewed for spec completeness"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#capitalize" do
|
||||
it "returns a copy of self with the first character converted to uppercase and the remainder to lowercase" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/eql', __FILE__)
|
||||
require File.expand_path('../shared/equal_value', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/eql'
|
||||
require_relative 'shared/equal_value'
|
||||
|
||||
describe "String#===" do
|
||||
it_behaves_like :string_eql_value, :===
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#casecmp independent of case" do
|
||||
it "returns -1 when less than other" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#center with length, padding" do
|
||||
it "returns a new string of specified length with self centered and padded with padstr" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../shared/chars', __FILE__)
|
||||
require File.expand_path('../shared/each_char_without_block', __FILE__)
|
||||
require_relative 'shared/chars'
|
||||
require_relative 'shared/each_char_without_block'
|
||||
|
||||
describe "String#chars" do
|
||||
it_behaves_like :string_chars, :chars
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#chomp" do
|
||||
describe "when passed no argument" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#chop" do
|
||||
it "removes the final character" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#chr" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#clear" 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 "String#clone" do
|
||||
before :each do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: binary -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/codepoints', __FILE__)
|
||||
require File.expand_path('../shared/each_codepoint_without_block', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/codepoints'
|
||||
require_relative 'shared/each_codepoint_without_block'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#codepoints" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#<=> with String" do
|
||||
it "compares individual characters based on their ascii value" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/concat', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/concat'
|
||||
|
||||
describe "String#concat" do
|
||||
it_behaves_like :string_concat, :concat
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: binary -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#count" do
|
||||
it "counts occurrences of chars from the intersection of the specified sets" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#crypt" do
|
||||
# Note: MRI's documentation just says that the C stdlib function crypt() is
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
ruby_version_is '2.5' do
|
||||
describe "String#delete_prefix" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#delete" do
|
||||
it "returns a new string with the chars from the intersection of sets removed" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
ruby_version_is '2.5' do
|
||||
describe "String#delete_suffix" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#downcase" do
|
||||
it "returns a copy of self with all uppercase letters downcased" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: 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 "String#dump" do
|
||||
it "taints the result if self is tainted" 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 "String#dup" do
|
||||
before :each do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#each_byte" do
|
||||
it "passes each byte in self to the given block" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../shared/chars', __FILE__)
|
||||
require File.expand_path('../shared/each_char_without_block', __FILE__)
|
||||
require_relative 'shared/chars'
|
||||
require_relative 'shared/each_char_without_block'
|
||||
|
||||
describe "String#each_char" do
|
||||
it_behaves_like :string_chars, :each_char
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/codepoints', __FILE__)
|
||||
require File.expand_path('../shared/each_codepoint_without_block', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/codepoints'
|
||||
require_relative 'shared/each_codepoint_without_block'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#each_codepoint" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/each_line', __FILE__)
|
||||
require File.expand_path('../shared/each_line_without_block', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/each_line'
|
||||
require_relative 'shared/each_line_without_block'
|
||||
|
||||
describe "String#each_line" do
|
||||
it_behaves_like :string_each_line, :each_line
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/slice.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/slice'
|
||||
|
||||
describe "String#[]" do
|
||||
it_behaves_like :string_slice, :[]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
# TODO: Add missing String#[]= specs:
|
||||
# String#[re, idx] = obj
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#empty?" do
|
||||
it "returns true if the string has a length of zero" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/encode', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/encode'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#encode" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: us-ascii -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/iso-8859-9-encoding', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/iso-8859-9-encoding'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#encoding" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#end_with?" do
|
||||
it "returns true only if ends match" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/eql', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/eql'
|
||||
|
||||
describe "String#eql?" do
|
||||
it_behaves_like :string_eql_value, :eql?
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../shared/eql', __FILE__)
|
||||
require File.expand_path('../shared/equal_value', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'shared/eql'
|
||||
require_relative 'shared/equal_value'
|
||||
|
||||
describe "String#==" do
|
||||
it_behaves_like :string_eql_value, :==
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#force_encoding" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#freeze" do
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#getbyte" do
|
||||
it "returns an Integer if given a valid index" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe :string_gsub_named_capture, shared: true do
|
||||
it "replaces \\k named backreferences with the regexp's corresponding capture" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#hash" do
|
||||
it "returns a hash based on a string's length and content" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
# TODO: Move actual results to String#to_int() and spec in terms of it
|
||||
describe "String#hex" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#include? with String" do
|
||||
it "returns true if self contains other_str" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#index" do
|
||||
it "raises a TypeError if passed nil" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/replace', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/replace'
|
||||
|
||||
describe "String#initialize" do
|
||||
it "is a private method" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#insert with index, other" do
|
||||
it "inserts other before the character at the given index" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#inspect" do
|
||||
it "taints the result if self is tainted" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/to_sym.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/to_sym'
|
||||
|
||||
describe "String#intern" do
|
||||
it_behaves_like :string_to_sym, :intern
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/length', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/length'
|
||||
|
||||
describe "String#length" do
|
||||
it_behaves_like :string_length, :length
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/each_line', __FILE__)
|
||||
require File.expand_path('../shared/each_line_without_block', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/each_line'
|
||||
require_relative 'shared/each_line_without_block'
|
||||
|
||||
describe "String#lines" do
|
||||
it_behaves_like :string_each_line, :lines
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#ljust with length, padding" do
|
||||
it "returns a new string of specified length with self left justified and padded with padstr" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#lstrip" do
|
||||
it "returns a copy of self with leading whitespace removed" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe :string_match_escaped_literal, shared: true do
|
||||
not_supported_on :opal do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../../../shared/hash/key_error', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative '../../shared/hash/key_error'
|
||||
|
||||
describe "String#%" do
|
||||
context "when key is missing from passed-in hash" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../../../shared/string/times', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative '../../shared/string/times'
|
||||
|
||||
describe "String#*" do
|
||||
it_behaves_like :string_times, :*, ->(str, times) { str * times }
|
||||
|
|
|
@ -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 "String.new" do
|
||||
it "returns an instance of String" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/succ.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/succ'
|
||||
|
||||
describe "String#next" do
|
||||
it_behaves_like :string_succ, :next
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
# Note: We can't completely spec this in terms of to_int() because hex()
|
||||
# allows the base to be changed by a base specifier in the string.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
with_feature :encoding do
|
||||
describe "String#ord" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#partition with String" do
|
||||
it "returns an array of substrings based on splitting on the given string" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../../kernel/shared/sprintf', __FILE__)
|
||||
require File.expand_path('../../kernel/shared/sprintf_encoding', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative '../kernel/shared/sprintf'
|
||||
require_relative '../kernel/shared/sprintf_encoding'
|
||||
|
||||
describe "String#%" do
|
||||
it_behaves_like :kernel_sprintf, -> (format, *args) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/concat', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/concat'
|
||||
|
||||
describe "String#+" do
|
||||
it "returns a new string containing the given string concatenated to self" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#prepend" do
|
||||
it "prepends the given argument to self and returns self" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes', __FILE__)
|
||||
require File.expand_path('../shared/replace', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/replace'
|
||||
|
||||
describe "String#replace" do
|
||||
it_behaves_like :string_replace, :replace
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#reverse" do
|
||||
it "returns a new string with the characters of self in reverse order" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../fixtures/utf-8-encoding.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'fixtures/utf-8-encoding'
|
||||
|
||||
describe "String#rindex with object" do
|
||||
it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#rjust with length, padding" do
|
||||
it "returns a new string of specified length with self right justified and padded with padstr" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#rpartition with String" do
|
||||
it "returns an array of substrings based on splitting on the given string" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#rstrip" do
|
||||
it "returns a copy of self with trailing whitespace removed" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#scan" do
|
||||
it "returns an array containing all matches" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path("../../../spec_helper", __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#scrub with a default replacement" do
|
||||
it "returns self for valid strings" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#setbyte" do
|
||||
it "returns an Integer" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: 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 :string_chars, shared: true do
|
||||
it "passes each char in self to the given block" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: 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 :string_each_char_without_block, shared: true do
|
||||
describe "when no block is given" 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 :string_eql_value, shared: true do
|
||||
it "returns true if self <=> string returns 0" 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 :string_equal_value, shared: true do
|
||||
it "returns false if obj does not respond to to_str" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/length', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/length'
|
||||
|
||||
describe "String#size" do
|
||||
it_behaves_like :string_length, :size
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/slice.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/slice'
|
||||
|
||||
describe "String#slice" do
|
||||
it_behaves_like :string_slice, :slice
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#split with String" do
|
||||
with_feature :encoding do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: binary -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
# TODO: rewrite all these specs
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#start_with?" do
|
||||
it "returns true only if beginning match" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String" do
|
||||
it "includes Comparable" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#strip" do
|
||||
it "returns a new string with leading and trailing whitespace removed" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#sub with pattern, replacement" do
|
||||
it "returns a copy of self when no modification is made" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/succ.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/succ'
|
||||
|
||||
describe "String#succ" do
|
||||
it_behaves_like :string_succ, :succ
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#sum" do
|
||||
it "returns a basic n-bit checksum of the characters in self" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#swapcase" do
|
||||
it "returns a new string with all uppercase chars from self converted to lowercase and vice versa" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#to_c" do
|
||||
it "returns a Complex object" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
# src.scan(/[+-]?[\d_]+\.[\d_]+(e[+-]?[\d_]+)?\b|[+-]?[\d_]+e[+-]?[\d_]+\b/i)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#to_i" do
|
||||
it "returns 0 for strings with leading underscores" do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
describe "String#to_r" do
|
||||
it "returns a Rational object" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/to_s.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/to_s'
|
||||
|
||||
describe "String#to_s" do
|
||||
it_behaves_like :string_to_s, :to_s
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/to_s.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/to_s'
|
||||
|
||||
describe "String#to_str" do
|
||||
it_behaves_like :string_to_s, :to_str
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require File.expand_path('../shared/to_sym.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
require_relative 'shared/to_sym'
|
||||
|
||||
describe "String#to_sym" do
|
||||
it_behaves_like :string_to_sym, :to_sym
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#tr_s" do
|
||||
it "returns a string processed according to tr with newly duplicate characters removed" do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
require File.expand_path('../fixtures/classes.rb', __FILE__)
|
||||
require_relative '../../spec_helper'
|
||||
require_relative 'fixtures/classes'
|
||||
|
||||
describe "String#tr" do
|
||||
it "returns a new string with the characters from from_string replaced by the ones in to_string" do
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue