diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-04 15:09:32 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-04 15:09:32 +0000 |
commit | 401b64c4e840bc8887219e9e445a64b3d5943656 (patch) | |
tree | 989b93914e9a8ee57ef3ce0bb3d2e2083470fc49 /spec/ruby/core/string | |
parent | 8a15857a7f283101a3923b76c71a1f05bfe58512 (diff) |
Update to ruby/spec@c1b568b
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/string')
133 files changed, 309 insertions, 309 deletions
diff --git a/spec/ruby/core/string/allocate_spec.rb b/spec/ruby/core/string/allocate_spec.rb index 9048815c5d..5b36b4fd05 100644 --- a/spec/ruby/core/string/allocate_spec.rb +++ b/spec/ruby/core/string/allocate_spec.rb @@ -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 diff --git a/spec/ruby/core/string/append_spec.rb b/spec/ruby/core/string/append_spec.rb index 87b2dca725..1e1667f617 100644 --- a/spec/ruby/core/string/append_spec.rb +++ b/spec/ruby/core/string/append_spec.rb @@ -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, :<< diff --git a/spec/ruby/core/string/ascii_only_spec.rb b/spec/ruby/core/string/ascii_only_spec.rb index 1bf9cfa4a1..3dce10fab3 100644 --- a/spec/ruby/core/string/ascii_only_spec.rb +++ b/spec/ruby/core/string/ascii_only_spec.rb @@ -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 diff --git a/spec/ruby/core/string/b_spec.rb b/spec/ruby/core/string/b_spec.rb index 89fcedf7c4..6599c23d73 100644 --- a/spec/ruby/core/string/b_spec.rb +++ b/spec/ruby/core/string/b_spec.rb @@ -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 diff --git a/spec/ruby/core/string/bytes_spec.rb b/spec/ruby/core/string/bytes_spec.rb index b1f5ba412f..e7d3a7fbd8 100644 --- a/spec/ruby/core/string/bytes_spec.rb +++ b/spec/ruby/core/string/bytes_spec.rb @@ -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 diff --git a/spec/ruby/core/string/bytesize_spec.rb b/spec/ruby/core/string/bytesize_spec.rb index 51da179da8..527b4a5dd5 100644 --- a/spec/ruby/core/string/bytesize_spec.rb +++ b/spec/ruby/core/string/bytesize_spec.rb @@ -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 diff --git a/spec/ruby/core/string/byteslice_spec.rb b/spec/ruby/core/string/byteslice_spec.rb index 263810971e..df99db95c6 100644 --- a/spec/ruby/core/string/byteslice_spec.rb +++ b/spec/ruby/core/string/byteslice_spec.rb @@ -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" diff --git a/spec/ruby/core/string/capitalize_spec.rb b/spec/ruby/core/string/capitalize_spec.rb index 971b06281e..e279f7d061 100644 --- a/spec/ruby/core/string/capitalize_spec.rb +++ b/spec/ruby/core/string/capitalize_spec.rb @@ -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 diff --git a/spec/ruby/core/string/case_compare_spec.rb b/spec/ruby/core/string/case_compare_spec.rb index a4f2d7960e..b83d1adb91 100644 --- a/spec/ruby/core/string/case_compare_spec.rb +++ b/spec/ruby/core/string/case_compare_spec.rb @@ -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, :=== diff --git a/spec/ruby/core/string/casecmp_spec.rb b/spec/ruby/core/string/casecmp_spec.rb index f556c79346..9e89e1314d 100644 --- a/spec/ruby/core/string/casecmp_spec.rb +++ b/spec/ruby/core/string/casecmp_spec.rb @@ -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 diff --git a/spec/ruby/core/string/center_spec.rb b/spec/ruby/core/string/center_spec.rb index 4a40ef88bf..145db01b70 100644 --- a/spec/ruby/core/string/center_spec.rb +++ b/spec/ruby/core/string/center_spec.rb @@ -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 diff --git a/spec/ruby/core/string/chars_spec.rb b/spec/ruby/core/string/chars_spec.rb index 7f764a3e43..54876f9f9d 100644 --- a/spec/ruby/core/string/chars_spec.rb +++ b/spec/ruby/core/string/chars_spec.rb @@ -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 diff --git a/spec/ruby/core/string/chomp_spec.rb b/spec/ruby/core/string/chomp_spec.rb index 4f7486b0f7..6fa8d7c6c5 100644 --- a/spec/ruby/core/string/chomp_spec.rb +++ b/spec/ruby/core/string/chomp_spec.rb @@ -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 diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb index 6afee99685..57c037322d 100644 --- a/spec/ruby/core/string/chop_spec.rb +++ b/spec/ruby/core/string/chop_spec.rb @@ -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 diff --git a/spec/ruby/core/string/chr_spec.rb b/spec/ruby/core/string/chr_spec.rb index a5e0cc4c88..ca56955866 100644 --- a/spec/ruby/core/string/chr_spec.rb +++ b/spec/ruby/core/string/chr_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' with_feature :encoding do describe "String#chr" do diff --git a/spec/ruby/core/string/clear_spec.rb b/spec/ruby/core/string/clear_spec.rb index 3db8b54cb0..8b0ff8a8e6 100644 --- a/spec/ruby/core/string/clear_spec.rb +++ b/spec/ruby/core/string/clear_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' with_feature :encoding do describe "String#clear" do diff --git a/spec/ruby/core/string/clone_spec.rb b/spec/ruby/core/string/clone_spec.rb index 3940858e53..6259cf89ef 100644 --- a/spec/ruby/core/string/clone_spec.rb +++ b/spec/ruby/core/string/clone_spec.rb @@ -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 diff --git a/spec/ruby/core/string/codepoints_spec.rb b/spec/ruby/core/string/codepoints_spec.rb index bae83ba86d..66f2884168 100644 --- a/spec/ruby/core/string/codepoints_spec.rb +++ b/spec/ruby/core/string/codepoints_spec.rb @@ -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 diff --git a/spec/ruby/core/string/comparison_spec.rb b/spec/ruby/core/string/comparison_spec.rb index 5a0e7fabc3..01199274b6 100644 --- a/spec/ruby/core/string/comparison_spec.rb +++ b/spec/ruby/core/string/comparison_spec.rb @@ -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 diff --git a/spec/ruby/core/string/concat_spec.rb b/spec/ruby/core/string/concat_spec.rb index 939be5ed0a..27917d6c85 100644 --- a/spec/ruby/core/string/concat_spec.rb +++ b/spec/ruby/core/string/concat_spec.rb @@ -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 diff --git a/spec/ruby/core/string/count_spec.rb b/spec/ruby/core/string/count_spec.rb index 3afb79a9fc..e82a7c77ca 100644 --- a/spec/ruby/core/string/count_spec.rb +++ b/spec/ruby/core/string/count_spec.rb @@ -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 diff --git a/spec/ruby/core/string/crypt_spec.rb b/spec/ruby/core/string/crypt_spec.rb index d3bf5ec732..697dfd5190 100644 --- a/spec/ruby/core/string/crypt_spec.rb +++ b/spec/ruby/core/string/crypt_spec.rb @@ -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 diff --git a/spec/ruby/core/string/delete_prefix_spec.rb b/spec/ruby/core/string/delete_prefix_spec.rb index 973fc951cb..4b4858c9c2 100644 --- a/spec/ruby/core/string/delete_prefix_spec.rb +++ b/spec/ruby/core/string/delete_prefix_spec.rb @@ -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 diff --git a/spec/ruby/core/string/delete_spec.rb b/spec/ruby/core/string/delete_spec.rb index 049f56e926..8725b54c3b 100644 --- a/spec/ruby/core/string/delete_spec.rb +++ b/spec/ruby/core/string/delete_spec.rb @@ -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 diff --git a/spec/ruby/core/string/delete_suffix_spec.rb b/spec/ruby/core/string/delete_suffix_spec.rb index 72adcacc55..8541c1d5d2 100644 --- a/spec/ruby/core/string/delete_suffix_spec.rb +++ b/spec/ruby/core/string/delete_suffix_spec.rb @@ -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 diff --git a/spec/ruby/core/string/downcase_spec.rb b/spec/ruby/core/string/downcase_spec.rb index adb5f83cfa..30116db5e6 100644 --- a/spec/ruby/core/string/downcase_spec.rb +++ b/spec/ruby/core/string/downcase_spec.rb @@ -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 diff --git a/spec/ruby/core/string/dump_spec.rb b/spec/ruby/core/string/dump_spec.rb index db743ad08f..503848221c 100644 --- a/spec/ruby/core/string/dump_spec.rb +++ b/spec/ruby/core/string/dump_spec.rb @@ -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 diff --git a/spec/ruby/core/string/dup_spec.rb b/spec/ruby/core/string/dup_spec.rb index 81fb1308cc..3c6021b5c2 100644 --- a/spec/ruby/core/string/dup_spec.rb +++ b/spec/ruby/core/string/dup_spec.rb @@ -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 diff --git a/spec/ruby/core/string/each_byte_spec.rb b/spec/ruby/core/string/each_byte_spec.rb index 2282cd6d7a..e04dca807f 100644 --- a/spec/ruby/core/string/each_byte_spec.rb +++ b/spec/ruby/core/string/each_byte_spec.rb @@ -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 diff --git a/spec/ruby/core/string/each_char_spec.rb b/spec/ruby/core/string/each_char_spec.rb index 4894c745c7..aff98c0a5c 100644 --- a/spec/ruby/core/string/each_char_spec.rb +++ b/spec/ruby/core/string/each_char_spec.rb @@ -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 diff --git a/spec/ruby/core/string/each_codepoint_spec.rb b/spec/ruby/core/string/each_codepoint_spec.rb index 3ad4b719fc..41ca527653 100644 --- a/spec/ruby/core/string/each_codepoint_spec.rb +++ b/spec/ruby/core/string/each_codepoint_spec.rb @@ -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 diff --git a/spec/ruby/core/string/each_line_spec.rb b/spec/ruby/core/string/each_line_spec.rb index ede272a0a0..90fc920bf1 100644 --- a/spec/ruby/core/string/each_line_spec.rb +++ b/spec/ruby/core/string/each_line_spec.rb @@ -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 diff --git a/spec/ruby/core/string/element_reference_spec.rb b/spec/ruby/core/string/element_reference_spec.rb index 785bbdaf80..f6e1750c93 100644 --- a/spec/ruby/core/string/element_reference_spec.rb +++ b/spec/ruby/core/string/element_reference_spec.rb @@ -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, :[] diff --git a/spec/ruby/core/string/element_set_spec.rb b/spec/ruby/core/string/element_set_spec.rb index 9c02afed8d..80ec5755c6 100644 --- a/spec/ruby/core/string/element_set_spec.rb +++ b/spec/ruby/core/string/element_set_spec.rb @@ -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 diff --git a/spec/ruby/core/string/empty_spec.rb b/spec/ruby/core/string/empty_spec.rb index c13e1145e4..fb52070723 100644 --- a/spec/ruby/core/string/empty_spec.rb +++ b/spec/ruby/core/string/empty_spec.rb @@ -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 diff --git a/spec/ruby/core/string/encode_spec.rb b/spec/ruby/core/string/encode_spec.rb index 5b6fa7e50c..f582d50794 100644 --- a/spec/ruby/core/string/encode_spec.rb +++ b/spec/ruby/core/string/encode_spec.rb @@ -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 diff --git a/spec/ruby/core/string/encoding_spec.rb b/spec/ruby/core/string/encoding_spec.rb index 9c655757a8..b2861f2264 100644 --- a/spec/ruby/core/string/encoding_spec.rb +++ b/spec/ruby/core/string/encoding_spec.rb @@ -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 diff --git a/spec/ruby/core/string/end_with_spec.rb b/spec/ruby/core/string/end_with_spec.rb index 2c3ff07272..7268378a38 100644 --- a/spec/ruby/core/string/end_with_spec.rb +++ b/spec/ruby/core/string/end_with_spec.rb @@ -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 diff --git a/spec/ruby/core/string/eql_spec.rb b/spec/ruby/core/string/eql_spec.rb index ccc0bcbaa8..397974d9fb 100644 --- a/spec/ruby/core/string/eql_spec.rb +++ b/spec/ruby/core/string/eql_spec.rb @@ -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? diff --git a/spec/ruby/core/string/equal_value_spec.rb b/spec/ruby/core/string/equal_value_spec.rb index cec6843fe6..b9c9c372f8 100644 --- a/spec/ruby/core/string/equal_value_spec.rb +++ b/spec/ruby/core/string/equal_value_spec.rb @@ -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, :== diff --git a/spec/ruby/core/string/force_encoding_spec.rb b/spec/ruby/core/string/force_encoding_spec.rb index a2464dc904..c317c84c1f 100644 --- a/spec/ruby/core/string/force_encoding_spec.rb +++ b/spec/ruby/core/string/force_encoding_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' with_feature :encoding do describe "String#force_encoding" do diff --git a/spec/ruby/core/string/freeze_spec.rb b/spec/ruby/core/string/freeze_spec.rb index 476f50fbed..04d1e9513c 100644 --- a/spec/ruby/core/string/freeze_spec.rb +++ b/spec/ruby/core/string/freeze_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' describe "String#freeze" do diff --git a/spec/ruby/core/string/getbyte_spec.rb b/spec/ruby/core/string/getbyte_spec.rb index b46ab1ab64..84286ada92 100644 --- a/spec/ruby/core/string/getbyte_spec.rb +++ b/spec/ruby/core/string/getbyte_spec.rb @@ -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 diff --git a/spec/ruby/core/string/gsub_spec.rb b/spec/ruby/core/string/gsub_spec.rb index 319dc2e3e1..a94010edea 100644 --- a/spec/ruby/core/string/gsub_spec.rb +++ b/spec/ruby/core/string/gsub_spec.rb @@ -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 diff --git a/spec/ruby/core/string/hash_spec.rb b/spec/ruby/core/string/hash_spec.rb index 255168cebd..0b26214b55 100644 --- a/spec/ruby/core/string/hash_spec.rb +++ b/spec/ruby/core/string/hash_spec.rb @@ -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 diff --git a/spec/ruby/core/string/hex_spec.rb b/spec/ruby/core/string/hex_spec.rb index 8a9257c310..364e915681 100644 --- a/spec/ruby/core/string/hex_spec.rb +++ b/spec/ruby/core/string/hex_spec.rb @@ -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 diff --git a/spec/ruby/core/string/include_spec.rb b/spec/ruby/core/string/include_spec.rb index d7780de602..03ef3ba802 100644 --- a/spec/ruby/core/string/include_spec.rb +++ b/spec/ruby/core/string/include_spec.rb @@ -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 diff --git a/spec/ruby/core/string/index_spec.rb b/spec/ruby/core/string/index_spec.rb index 7889f69c5d..3ed27034e1 100644 --- a/spec/ruby/core/string/index_spec.rb +++ b/spec/ruby/core/string/index_spec.rb @@ -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 diff --git a/spec/ruby/core/string/initialize_spec.rb b/spec/ruby/core/string/initialize_spec.rb index cbb281c8d5..08734cc916 100644 --- a/spec/ruby/core/string/initialize_spec.rb +++ b/spec/ruby/core/string/initialize_spec.rb @@ -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 diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb index 8bae38f074..2c72bb5ffd 100644 --- a/spec/ruby/core/string/insert_spec.rb +++ b/spec/ruby/core/string/insert_spec.rb @@ -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 diff --git a/spec/ruby/core/string/inspect_spec.rb b/spec/ruby/core/string/inspect_spec.rb index a3e18c0ee3..2cfcfe0e76 100644 --- a/spec/ruby/core/string/inspect_spec.rb +++ b/spec/ruby/core/string/inspect_spec.rb @@ -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 diff --git a/spec/ruby/core/string/intern_spec.rb b/spec/ruby/core/string/intern_spec.rb index c0196f7e2c..cd7dad4359 100644 --- a/spec/ruby/core/string/intern_spec.rb +++ b/spec/ruby/core/string/intern_spec.rb @@ -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 diff --git a/spec/ruby/core/string/length_spec.rb b/spec/ruby/core/string/length_spec.rb index 215b5ec854..98cee1f03d 100644 --- a/spec/ruby/core/string/length_spec.rb +++ b/spec/ruby/core/string/length_spec.rb @@ -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 diff --git a/spec/ruby/core/string/lines_spec.rb b/spec/ruby/core/string/lines_spec.rb index 111cc14508..6b2d74daf1 100644 --- a/spec/ruby/core/string/lines_spec.rb +++ b/spec/ruby/core/string/lines_spec.rb @@ -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 diff --git a/spec/ruby/core/string/ljust_spec.rb b/spec/ruby/core/string/ljust_spec.rb index f66fb0c573..5838a0c9f9 100644 --- a/spec/ruby/core/string/ljust_spec.rb +++ b/spec/ruby/core/string/ljust_spec.rb @@ -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 diff --git a/spec/ruby/core/string/lstrip_spec.rb b/spec/ruby/core/string/lstrip_spec.rb index b35e359928..ecfc89dd6b 100644 --- a/spec/ruby/core/string/lstrip_spec.rb +++ b/spec/ruby/core/string/lstrip_spec.rb @@ -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 diff --git a/spec/ruby/core/string/match_spec.rb b/spec/ruby/core/string/match_spec.rb index 94e28e7297..7f3d9ebae5 100644 --- a/spec/ruby/core/string/match_spec.rb +++ b/spec/ruby/core/string/match_spec.rb @@ -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 diff --git a/spec/ruby/core/string/modulo_spec.rb b/spec/ruby/core/string/modulo_spec.rb index 7cb3561b17..e81b27e4ce 100644 --- a/spec/ruby/core/string/modulo_spec.rb +++ b/spec/ruby/core/string/modulo_spec.rb @@ -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 diff --git a/spec/ruby/core/string/multiply_spec.rb b/spec/ruby/core/string/multiply_spec.rb index d932ebeb8e..7d887fd93a 100644 --- a/spec/ruby/core/string/multiply_spec.rb +++ b/spec/ruby/core/string/multiply_spec.rb @@ -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 } diff --git a/spec/ruby/core/string/new_spec.rb b/spec/ruby/core/string/new_spec.rb index b429ac48d2..7d1c361bf8 100644 --- a/spec/ruby/core/string/new_spec.rb +++ b/spec/ruby/core/string/new_spec.rb @@ -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 diff --git a/spec/ruby/core/string/next_spec.rb b/spec/ruby/core/string/next_spec.rb index 185f857cf0..fcd3e5ef90 100644 --- a/spec/ruby/core/string/next_spec.rb +++ b/spec/ruby/core/string/next_spec.rb @@ -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 diff --git a/spec/ruby/core/string/oct_spec.rb b/spec/ruby/core/string/oct_spec.rb index 7cdbabc436..7637692217 100644 --- a/spec/ruby/core/string/oct_spec.rb +++ b/spec/ruby/core/string/oct_spec.rb @@ -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. diff --git a/spec/ruby/core/string/ord_spec.rb b/spec/ruby/core/string/ord_spec.rb index 64466fde58..8ba110c973 100644 --- a/spec/ruby/core/string/ord_spec.rb +++ b/spec/ruby/core/string/ord_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' with_feature :encoding do describe "String#ord" do diff --git a/spec/ruby/core/string/partition_spec.rb b/spec/ruby/core/string/partition_spec.rb index 04f49db1b1..f7ab5f85aa 100644 --- a/spec/ruby/core/string/partition_spec.rb +++ b/spec/ruby/core/string/partition_spec.rb @@ -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 diff --git a/spec/ruby/core/string/percent_spec.rb b/spec/ruby/core/string/percent_spec.rb index 5eeb98c217..2ddcab7907 100644 --- a/spec/ruby/core/string/percent_spec.rb +++ b/spec/ruby/core/string/percent_spec.rb @@ -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) { diff --git a/spec/ruby/core/string/plus_spec.rb b/spec/ruby/core/string/plus_spec.rb index addc8873eb..a9f287a82b 100644 --- a/spec/ruby/core/string/plus_spec.rb +++ b/spec/ruby/core/string/plus_spec.rb @@ -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 diff --git a/spec/ruby/core/string/prepend_spec.rb b/spec/ruby/core/string/prepend_spec.rb index 81618a4d7c..cbe83524b8 100644 --- a/spec/ruby/core/string/prepend_spec.rb +++ b/spec/ruby/core/string/prepend_spec.rb @@ -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 diff --git a/spec/ruby/core/string/replace_spec.rb b/spec/ruby/core/string/replace_spec.rb index 0f59a9a1ab..ef9bab4f3c 100644 --- a/spec/ruby/core/string/replace_spec.rb +++ b/spec/ruby/core/string/replace_spec.rb @@ -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 diff --git a/spec/ruby/core/string/reverse_spec.rb b/spec/ruby/core/string/reverse_spec.rb index 5b183fef4f..7cb171cb81 100644 --- a/spec/ruby/core/string/reverse_spec.rb +++ b/spec/ruby/core/string/reverse_spec.rb @@ -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 diff --git a/spec/ruby/core/string/rindex_spec.rb b/spec/ruby/core/string/rindex_spec.rb index 7085914189..98e36785e3 100644 --- a/spec/ruby/core/string/rindex_spec.rb +++ b/spec/ruby/core/string/rindex_spec.rb @@ -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 diff --git a/spec/ruby/core/string/rjust_spec.rb b/spec/ruby/core/string/rjust_spec.rb index 85cb1fe213..c2cfae7b66 100644 --- a/spec/ruby/core/string/rjust_spec.rb +++ b/spec/ruby/core/string/rjust_spec.rb @@ -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 diff --git a/spec/ruby/core/string/rpartition_spec.rb b/spec/ruby/core/string/rpartition_spec.rb index c58d96f298..a5222e0a2a 100644 --- a/spec/ruby/core/string/rpartition_spec.rb +++ b/spec/ruby/core/string/rpartition_spec.rb @@ -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 diff --git a/spec/ruby/core/string/rstrip_spec.rb b/spec/ruby/core/string/rstrip_spec.rb index aa3f70a166..6376e5df33 100644 --- a/spec/ruby/core/string/rstrip_spec.rb +++ b/spec/ruby/core/string/rstrip_spec.rb @@ -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 diff --git a/spec/ruby/core/string/scan_spec.rb b/spec/ruby/core/string/scan_spec.rb index f09daa1b74..64a1c31443 100644 --- a/spec/ruby/core/string/scan_spec.rb +++ b/spec/ruby/core/string/scan_spec.rb @@ -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 diff --git a/spec/ruby/core/string/scrub_spec.rb b/spec/ruby/core/string/scrub_spec.rb index 815eb0fbb7..92e7641f0b 100644 --- a/spec/ruby/core/string/scrub_spec.rb +++ b/spec/ruby/core/string/scrub_spec.rb @@ -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 diff --git a/spec/ruby/core/string/setbyte_spec.rb b/spec/ruby/core/string/setbyte_spec.rb index e27ab38d67..f998e61622 100644 --- a/spec/ruby/core/string/setbyte_spec.rb +++ b/spec/ruby/core/string/setbyte_spec.rb @@ -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 diff --git a/spec/ruby/core/string/shared/chars.rb b/spec/ruby/core/string/shared/chars.rb index c1cf324dc5..6a2fdb483f 100644 --- a/spec/ruby/core/string/shared/chars.rb +++ b/spec/ruby/core/string/shared/chars.rb @@ -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 diff --git a/spec/ruby/core/string/shared/each_char_without_block.rb b/spec/ruby/core/string/shared/each_char_without_block.rb index 40808cfd9f..397100ce0e 100644 --- a/spec/ruby/core/string/shared/each_char_without_block.rb +++ b/spec/ruby/core/string/shared/each_char_without_block.rb @@ -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 diff --git a/spec/ruby/core/string/shared/eql.rb b/spec/ruby/core/string/shared/eql.rb index 92dfa91923..85b861f4f1 100644 --- a/spec/ruby/core/string/shared/eql.rb +++ b/spec/ruby/core/string/shared/eql.rb @@ -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 diff --git a/spec/ruby/core/string/shared/equal_value.rb b/spec/ruby/core/string/shared/equal_value.rb index 6df76478c7..d797cb1483 100644 --- a/spec/ruby/core/string/shared/equal_value.rb +++ b/spec/ruby/core/string/shared/equal_value.rb @@ -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 diff --git a/spec/ruby/core/string/size_spec.rb b/spec/ruby/core/string/size_spec.rb index 7e1afd9c54..9e1f40c5ae 100644 --- a/spec/ruby/core/string/size_spec.rb +++ b/spec/ruby/core/string/size_spec.rb @@ -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 diff --git a/spec/ruby/core/string/slice_spec.rb b/spec/ruby/core/string/slice_spec.rb index fce64bd382..12876e757d 100644 --- a/spec/ruby/core/string/slice_spec.rb +++ b/spec/ruby/core/string/slice_spec.rb @@ -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 diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb index 1a4128f828..0d2c6211c4 100644 --- a/spec/ruby/core/string/split_spec.rb +++ b/spec/ruby/core/string/split_spec.rb @@ -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 diff --git a/spec/ruby/core/string/squeeze_spec.rb b/spec/ruby/core/string/squeeze_spec.rb index 01b9fe72ff..391b356227 100644 --- a/spec/ruby/core/string/squeeze_spec.rb +++ b/spec/ruby/core/string/squeeze_spec.rb @@ -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 diff --git a/spec/ruby/core/string/start_with_spec.rb b/spec/ruby/core/string/start_with_spec.rb index cba40d70f1..4e12c1a445 100644 --- a/spec/ruby/core/string/start_with_spec.rb +++ b/spec/ruby/core/string/start_with_spec.rb @@ -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 diff --git a/spec/ruby/core/string/string_spec.rb b/spec/ruby/core/string/string_spec.rb index 37a858acae..cdefbbecbd 100644 --- a/spec/ruby/core/string/string_spec.rb +++ b/spec/ruby/core/string/string_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' describe "String" do it "includes Comparable" do diff --git a/spec/ruby/core/string/strip_spec.rb b/spec/ruby/core/string/strip_spec.rb index 36eb38e4e4..54dec794fa 100644 --- a/spec/ruby/core/string/strip_spec.rb +++ b/spec/ruby/core/string/strip_spec.rb @@ -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 diff --git a/spec/ruby/core/string/sub_spec.rb b/spec/ruby/core/string/sub_spec.rb index ceda4ec794..901d1596c5 100644 --- a/spec/ruby/core/string/sub_spec.rb +++ b/spec/ruby/core/string/sub_spec.rb @@ -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 diff --git a/spec/ruby/core/string/succ_spec.rb b/spec/ruby/core/string/succ_spec.rb index 52b5a6c1ee..65047e0aa2 100644 --- a/spec/ruby/core/string/succ_spec.rb +++ b/spec/ruby/core/string/succ_spec.rb @@ -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 diff --git a/spec/ruby/core/string/sum_spec.rb b/spec/ruby/core/string/sum_spec.rb index 2d68668f49..c283b7c254 100644 --- a/spec/ruby/core/string/sum_spec.rb +++ b/spec/ruby/core/string/sum_spec.rb @@ -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 diff --git a/spec/ruby/core/string/swapcase_spec.rb b/spec/ruby/core/string/swapcase_spec.rb index d9127856d3..6d00906aad 100644 --- a/spec/ruby/core/string/swapcase_spec.rb +++ b/spec/ruby/core/string/swapcase_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_c_spec.rb b/spec/ruby/core/string/to_c_spec.rb index da353e18d5..9c84b14f4d 100644 --- a/spec/ruby/core/string/to_c_spec.rb +++ b/spec/ruby/core/string/to_c_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_f_spec.rb b/spec/ruby/core/string/to_f_spec.rb index 8454651ab2..ca8536c30e 100644 --- a/spec/ruby/core/string/to_f_spec.rb +++ b/spec/ruby/core/string/to_f_spec.rb @@ -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) diff --git a/spec/ruby/core/string/to_i_spec.rb b/spec/ruby/core/string/to_i_spec.rb index be0f67a46a..f86d3a43a7 100644 --- a/spec/ruby/core/string/to_i_spec.rb +++ b/spec/ruby/core/string/to_i_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_r_spec.rb b/spec/ruby/core/string/to_r_spec.rb index 7fa16f6f49..9f174a2f55 100644 --- a/spec/ruby/core/string/to_r_spec.rb +++ b/spec/ruby/core/string/to_r_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_s_spec.rb b/spec/ruby/core/string/to_s_spec.rb index 8551b080a6..e5872745a8 100644 --- a/spec/ruby/core/string/to_s_spec.rb +++ b/spec/ruby/core/string/to_s_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_str_spec.rb b/spec/ruby/core/string/to_str_spec.rb index a326b52bca..e24262a7ae 100644 --- a/spec/ruby/core/string/to_str_spec.rb +++ b/spec/ruby/core/string/to_str_spec.rb @@ -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 diff --git a/spec/ruby/core/string/to_sym_spec.rb b/spec/ruby/core/string/to_sym_spec.rb index cb41afc636..f9135211ce 100644 --- a/spec/ruby/core/string/to_sym_spec.rb +++ b/spec/ruby/core/string/to_sym_spec.rb @@ -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 diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb index e387ea2356..87635acf2c 100644 --- a/spec/ruby/core/string/tr_s_spec.rb +++ b/spec/ruby/core/string/tr_s_spec.rb @@ -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 diff --git a/spec/ruby/core/string/tr_spec.rb b/spec/ruby/core/string/tr_spec.rb index 55556c6e4f..efd5a7f638 100644 --- a/spec/ruby/core/string/tr_spec.rb +++ b/spec/ruby/core/string/tr_spec.rb @@ -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 diff --git a/spec/ruby/core/string/try_convert_spec.rb b/spec/ruby/core/string/try_convert_spec.rb index ce12839c59..629817110e 100644 --- a/spec/ruby/core/string/try_convert_spec.rb +++ b/spec/ruby/core/string/try_convert_spec.rb @@ -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.try_convert" do it "returns the argument if it's a String" do diff --git a/spec/ruby/core/string/uminus_spec.rb b/spec/ruby/core/string/uminus_spec.rb index f18e6b1234..a2b6fad098 100644 --- a/spec/ruby/core/string/uminus_spec.rb +++ b/spec/ruby/core/string/uminus_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' ruby_version_is "2.3" do describe 'String#-@' do diff --git a/spec/ruby/core/string/unicode_normalize_spec.rb b/spec/ruby/core/string/unicode_normalize_spec.rb index 138c0455fd..7a4662e0b8 100644 --- a/spec/ruby/core/string/unicode_normalize_spec.rb +++ b/spec/ruby/core/string/unicode_normalize_spec.rb @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' # Examples taken from http://www.unicode.org/reports/tr15/#Norm_Forms diff --git a/spec/ruby/core/string/unicode_normalized_spec.rb b/spec/ruby/core/string/unicode_normalized_spec.rb index dc5e2742e4..d383c0a91e 100644 --- a/spec/ruby/core/string/unicode_normalized_spec.rb +++ b/spec/ruby/core/string/unicode_normalized_spec.rb @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' describe "String#unicode_normalized?" do before :each do diff --git a/spec/ruby/core/string/unpack/a_spec.rb b/spec/ruby/core/string/unpack/a_spec.rb index 18882c91a6..0adcf0ff80 100644 --- a/spec/ruby/core/string/unpack/a_spec.rb +++ b/spec/ruby/core/string/unpack/a_spec.rb @@ -1,8 +1,8 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/string', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/string' describe "String#unpack with format 'A'" do it_behaves_like :string_unpack_basic, 'A' diff --git a/spec/ruby/core/string/unpack/at_spec.rb b/spec/ruby/core/string/unpack/at_spec.rb index 70cbebd2ba..a5f97b64f0 100644 --- a/spec/ruby/core/string/unpack/at_spec.rb +++ b/spec/ruby/core/string/unpack/at_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format '@'" do it_behaves_like :string_unpack_basic, '@' diff --git a/spec/ruby/core/string/unpack/b_spec.rb b/spec/ruby/core/string/unpack/b_spec.rb index fa632e6526..332c85b5f8 100644 --- a/spec/ruby/core/string/unpack/b_spec.rb +++ b/spec/ruby/core/string/unpack/b_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format 'B'" do it_behaves_like :string_unpack_basic, 'B' diff --git a/spec/ruby/core/string/unpack/c_spec.rb b/spec/ruby/core/string/unpack/c_spec.rb index 36de462cac..82c0f8616d 100644 --- a/spec/ruby/core/string/unpack/c_spec.rb +++ b/spec/ruby/core/string/unpack/c_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe :string_unpack_8bit, shared: true do it "decodes one byte for a single format character" do diff --git a/spec/ruby/core/string/unpack/comment_spec.rb b/spec/ruby/core/string/unpack/comment_spec.rb index 884960b337..7e7adbf54f 100644 --- a/spec/ruby/core/string/unpack/comment_spec.rb +++ b/spec/ruby/core/string/unpack/comment_spec.rb @@ -1,6 +1,6 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' describe "String#unpack" do it "ignores directives text from '#' to the first newline" do diff --git a/spec/ruby/core/string/unpack/d_spec.rb b/spec/ruby/core/string/unpack/d_spec.rb index db4638f8ef..0e4f57ec04 100644 --- a/spec/ruby/core/string/unpack/d_spec.rb +++ b/spec/ruby/core/string/unpack/d_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/float', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/float' little_endian do describe "String#unpack with format 'D'" do diff --git a/spec/ruby/core/string/unpack/e_spec.rb b/spec/ruby/core/string/unpack/e_spec.rb index cb74c00206..c958be1c8b 100644 --- a/spec/ruby/core/string/unpack/e_spec.rb +++ b/spec/ruby/core/string/unpack/e_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/float', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/float' describe "String#unpack with format 'E'" do it_behaves_like :string_unpack_basic, 'E' diff --git a/spec/ruby/core/string/unpack/f_spec.rb b/spec/ruby/core/string/unpack/f_spec.rb index 60dad46703..ec8b9d435e 100644 --- a/spec/ruby/core/string/unpack/f_spec.rb +++ b/spec/ruby/core/string/unpack/f_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/float', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/float' little_endian do describe "String#unpack with format 'F'" do diff --git a/spec/ruby/core/string/unpack/g_spec.rb b/spec/ruby/core/string/unpack/g_spec.rb index f5bec1534e..ffc423b152 100644 --- a/spec/ruby/core/string/unpack/g_spec.rb +++ b/spec/ruby/core/string/unpack/g_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/float', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/float' describe "String#unpack with format 'G'" do it_behaves_like :string_unpack_basic, 'G' diff --git a/spec/ruby/core/string/unpack/h_spec.rb b/spec/ruby/core/string/unpack/h_spec.rb index 00d6d68eee..7d0acf5718 100644 --- a/spec/ruby/core/string/unpack/h_spec.rb +++ b/spec/ruby/core/string/unpack/h_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format 'H'" do it_behaves_like :string_unpack_basic, 'H' diff --git a/spec/ruby/core/string/unpack/i_spec.rb b/spec/ruby/core/string/unpack/i_spec.rb index f3183afe99..b4bbba1923 100644 --- a/spec/ruby/core/string/unpack/i_spec.rb +++ b/spec/ruby/core/string/unpack/i_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'I'" do describe "with modifier '<'" do diff --git a/spec/ruby/core/string/unpack/j_spec.rb b/spec/ruby/core/string/unpack/j_spec.rb index 23d26d896e..8f4213bd97 100644 --- a/spec/ruby/core/string/unpack/j_spec.rb +++ b/spec/ruby/core/string/unpack/j_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' ruby_version_is '2.3' do platform_is pointer_size: 64 do diff --git a/spec/ruby/core/string/unpack/l_spec.rb b/spec/ruby/core/string/unpack/l_spec.rb index 11f0648fc7..6f9fcd4fd0 100644 --- a/spec/ruby/core/string/unpack/l_spec.rb +++ b/spec/ruby/core/string/unpack/l_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'L'" do describe "with modifier '<'" do diff --git a/spec/ruby/core/string/unpack/m_spec.rb b/spec/ruby/core/string/unpack/m_spec.rb index 104f282fed..0ae1118583 100644 --- a/spec/ruby/core/string/unpack/m_spec.rb +++ b/spec/ruby/core/string/unpack/m_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format 'M'" do it_behaves_like :string_unpack_basic, 'M' diff --git a/spec/ruby/core/string/unpack/n_spec.rb b/spec/ruby/core/string/unpack/n_spec.rb index 6e85346338..09173f4fcb 100644 --- a/spec/ruby/core/string/unpack/n_spec.rb +++ b/spec/ruby/core/string/unpack/n_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'N'" do it_behaves_like :string_unpack_basic, 'N' diff --git a/spec/ruby/core/string/unpack/p_spec.rb b/spec/ruby/core/string/unpack/p_spec.rb index 7c9a502a15..57b51fef00 100644 --- a/spec/ruby/core/string/unpack/p_spec.rb +++ b/spec/ruby/core/string/unpack/p_spec.rb @@ -1,6 +1,6 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format 'P'" do it_behaves_like :string_unpack_basic, 'P' diff --git a/spec/ruby/core/string/unpack/percent_spec.rb b/spec/ruby/core/string/unpack/percent_spec.rb index 38cf81b037..f0684d4cbc 100644 --- a/spec/ruby/core/string/unpack/percent_spec.rb +++ b/spec/ruby/core/string/unpack/percent_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../../spec_helper', __FILE__) +require_relative '../../../spec_helper' describe "String#unpack with format '%'" do it "raises an Argument Error" do diff --git a/spec/ruby/core/string/unpack/q_spec.rb b/spec/ruby/core/string/unpack/q_spec.rb index 91e65a9405..2f667d6c4d 100644 --- a/spec/ruby/core/string/unpack/q_spec.rb +++ b/spec/ruby/core/string/unpack/q_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'Q'" do describe "with modifier '<'" do diff --git a/spec/ruby/core/string/unpack/s_spec.rb b/spec/ruby/core/string/unpack/s_spec.rb index c6b079b0a6..d331fd720e 100644 --- a/spec/ruby/core/string/unpack/s_spec.rb +++ b/spec/ruby/core/string/unpack/s_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'S'" do describe "with modifier '<'" do diff --git a/spec/ruby/core/string/unpack/u_spec.rb b/spec/ruby/core/string/unpack/u_spec.rb index 0765da8d96..6326bd7963 100644 --- a/spec/ruby/core/string/unpack/u_spec.rb +++ b/spec/ruby/core/string/unpack/u_spec.rb @@ -1,8 +1,8 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/unicode', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/unicode' describe "String#unpack with format 'U'" do it_behaves_like :string_unpack_basic, 'U' diff --git a/spec/ruby/core/string/unpack/v_spec.rb b/spec/ruby/core/string/unpack/v_spec.rb index 33cf23c68b..929e8712cb 100644 --- a/spec/ruby/core/string/unpack/v_spec.rb +++ b/spec/ruby/core/string/unpack/v_spec.rb @@ -1,7 +1,7 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/integer', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/integer' describe "String#unpack with format 'V'" do it_behaves_like :string_unpack_basic, 'V' diff --git a/spec/ruby/core/string/unpack/w_spec.rb b/spec/ruby/core/string/unpack/w_spec.rb index 22f5980a46..8ff926783e 100644 --- a/spec/ruby/core/string/unpack/w_spec.rb +++ b/spec/ruby/core/string/unpack/w_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with directive 'w'" do it_behaves_like :string_unpack_basic, 'w' diff --git a/spec/ruby/core/string/unpack/x_spec.rb b/spec/ruby/core/string/unpack/x_spec.rb index e765472413..22b641b732 100644 --- a/spec/ruby/core/string/unpack/x_spec.rb +++ b/spec/ruby/core/string/unpack/x_spec.rb @@ -1,7 +1,7 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' describe "String#unpack with format 'X'" do it_behaves_like :string_unpack_basic, 'X' diff --git a/spec/ruby/core/string/unpack/z_spec.rb b/spec/ruby/core/string/unpack/z_spec.rb index 7c3d167ac2..67d36ac8bf 100644 --- a/spec/ruby/core/string/unpack/z_spec.rb +++ b/spec/ruby/core/string/unpack/z_spec.rb @@ -1,8 +1,8 @@ # -*- encoding: ascii-8bit -*- -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) -require File.expand_path('../shared/basic', __FILE__) -require File.expand_path('../shared/string', __FILE__) +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' +require_relative 'shared/basic' +require_relative 'shared/string' describe "String#unpack with format 'Z'" do it_behaves_like :string_unpack_basic, 'Z' diff --git a/spec/ruby/core/string/unpack1_spec.rb b/spec/ruby/core/string/unpack1_spec.rb index 6941bc1173..5b2157d85a 100644 --- a/spec/ruby/core/string/unpack1_spec.rb +++ b/spec/ruby/core/string/unpack1_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' ruby_version_is "2.4" do describe "String#unpack1" do diff --git a/spec/ruby/core/string/upcase_spec.rb b/spec/ruby/core/string/upcase_spec.rb index 31fd7fb8da..001cf1f495 100644 --- a/spec/ruby/core/string/upcase_spec.rb +++ b/spec/ruby/core/string/upcase_spec.rb @@ -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#upcase" do it "returns a copy of self with all lowercase letters upcased" do diff --git a/spec/ruby/core/string/uplus_spec.rb b/spec/ruby/core/string/uplus_spec.rb index eafa721903..6c6792590e 100644 --- a/spec/ruby/core/string/uplus_spec.rb +++ b/spec/ruby/core/string/uplus_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' ruby_version_is "2.3" do describe 'String#+@' do diff --git a/spec/ruby/core/string/upto_spec.rb b/spec/ruby/core/string/upto_spec.rb index 6b998eed3c..d2f1121360 100644 --- a/spec/ruby/core/string/upto_spec.rb +++ b/spec/ruby/core/string/upto_spec.rb @@ -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#upto" do it "passes successive values, starting at self and ending at other_string, to the block" do diff --git a/spec/ruby/core/string/valid_encoding_spec.rb b/spec/ruby/core/string/valid_encoding_spec.rb index ddd0fe52a2..c8cbbcf5ec 100644 --- a/spec/ruby/core/string/valid_encoding_spec.rb +++ b/spec/ruby/core/string/valid_encoding_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' with_feature :encoding do describe "String#valid_encoding?" do |