diff --git a/command_line/dash_upper_u_spec.rb b/command_line/dash_upper_u_spec.rb index 15854e7b73..2c210eb603 100644 --- a/command_line/dash_upper_u_spec.rb +++ b/command_line/dash_upper_u_spec.rb @@ -2,8 +2,8 @@ describe "ruby -U" do it "sets Encoding.default_internal to UTF-8" do - ruby_exe('print Encoding.default_internal.name', - options: '-U').should == 'UTF-8' + ruby_exe('print Encoding.default_internal.name', + options: '-U').should == 'UTF-8' end it "sets Encoding.default_internal to UTF-8 when RUBYOPT is empty or only spaces" do @@ -14,25 +14,25 @@ end it "does nothing different if specified multiple times" do - ruby_exe('print Encoding.default_internal.name', - options: '-U -U').should == 'UTF-8' + ruby_exe('print Encoding.default_internal.name', + options: '-U -U').should == 'UTF-8' end it "is overruled by Encoding.default_internal=" do - ruby_exe('Encoding.default_internal="ascii"; print Encoding.default_internal.name', - options: '-U').should == 'US-ASCII' + ruby_exe('Encoding.default_internal="ascii"; print Encoding.default_internal.name', + options: '-U').should == 'US-ASCII' end it "does not affect the default external encoding" do - ruby_exe('Encoding.default_external="ascii"; print Encoding.default_external.name', - options: '-U').should == 'US-ASCII' + ruby_exe('Encoding.default_external="ascii"; print Encoding.default_external.name', + options: '-U').should == 'US-ASCII' end it "does not affect the source encoding" do - ruby_exe("print __ENCODING__.name", - options: '-U -KE').should == 'EUC-JP' - ruby_exe("print __ENCODING__.name", - options: '-KE -U').should == 'EUC-JP' + ruby_exe("print __ENCODING__.name", + options: '-U -KE').should == 'EUC-JP' + ruby_exe("print __ENCODING__.name", + options: '-KE -U').should == 'EUC-JP' end # I assume IO redirection will break on Windows... diff --git a/core/array/drop_spec.rb b/core/array/drop_spec.rb index 0ea748e47d..5926c291b8 100644 --- a/core/array/drop_spec.rb +++ b/core/array/drop_spec.rb @@ -7,7 +7,7 @@ end it "raises an ArgumentError if the number of elements specified is negative" do - -> { [1, 2].drop(-3) }.should raise_error(ArgumentError) + -> { [1, 2].drop(-3) }.should raise_error(ArgumentError) end it "returns an empty Array if all elements are dropped" do diff --git a/core/complex/shared/rect.rb b/core/complex/shared/rect.rb index 9f5de1ffeb..4ac294e771 100644 --- a/core/complex/shared/rect.rb +++ b/core/complex/shared/rect.rb @@ -24,15 +24,15 @@ end it "returns the real part of self as the first element" do - @numbers.each do |number| - number.send(@method).first.should == number.real - end + @numbers.each do |number| + number.send(@method).first.should == number.real + end end it "returns the imaginary part of self as the last element" do - @numbers.each do |number| - number.send(@method).last.should == number.imaginary - end + @numbers.each do |number| + number.send(@method).last.should == number.imaginary + end end it "raises an ArgumentError if given any arguments" do diff --git a/core/encoding/converter/finish_spec.rb b/core/encoding/converter/finish_spec.rb index 239243430b..22e66df38c 100644 --- a/core/encoding/converter/finish_spec.rb +++ b/core/encoding/converter/finish_spec.rb @@ -16,8 +16,8 @@ end it "returns the last part of the converted String if it hasn't already" do - @ec.convert("\u{9999}").should == "\e$B9a".dup.force_encoding('iso-2022-jp') - @ec.finish.should == "\e(B".dup.force_encoding('iso-2022-jp') + @ec.convert("\u{9999}").should == "\e$B9a".dup.force_encoding('iso-2022-jp') + @ec.finish.should == "\e(B".dup.force_encoding('iso-2022-jp') end it "returns a String in the destination encoding" do diff --git a/core/encoding/converter/search_convpath_spec.rb b/core/encoding/converter/search_convpath_spec.rb index 0882af5539..59fe4520c0 100644 --- a/core/encoding/converter/search_convpath_spec.rb +++ b/core/encoding/converter/search_convpath_spec.rb @@ -23,8 +23,8 @@ end it "raises an Encoding::ConverterNotFoundError if no conversion path exists" do - -> do - Encoding::Converter.search_convpath(Encoding::BINARY, Encoding::Emacs_Mule) - end.should raise_error(Encoding::ConverterNotFoundError) + -> do + Encoding::Converter.search_convpath(Encoding::BINARY, Encoding::Emacs_Mule) + end.should raise_error(Encoding::ConverterNotFoundError) end end diff --git a/core/env/fetch_spec.rb b/core/env/fetch_spec.rb index b2e7a88cab..2c5d7cc3a0 100644 --- a/core/env/fetch_spec.rb +++ b/core/env/fetch_spec.rb @@ -47,7 +47,7 @@ it "warns on block and default parameter given" do -> do - ENV.fetch("foo", "default") { "bar" }.should == "bar" + ENV.fetch("foo", "default") { "bar" }.should == "bar" end.should complain(/block supersedes default value argument/) end diff --git a/core/env/length_spec.rb b/core/env/length_spec.rb index 536af9edf5..c6f9062892 100644 --- a/core/env/length_spec.rb +++ b/core/env/length_spec.rb @@ -2,5 +2,5 @@ require_relative 'shared/length' describe "ENV.length" do - it_behaves_like :env_length, :length + it_behaves_like :env_length, :length end diff --git a/core/env/size_spec.rb b/core/env/size_spec.rb index f050e9e5a9..7c8072481e 100644 --- a/core/env/size_spec.rb +++ b/core/env/size_spec.rb @@ -2,5 +2,5 @@ require_relative 'shared/length' describe "ENV.size" do - it_behaves_like :env_length, :size + it_behaves_like :env_length, :size end diff --git a/core/fiber/shared/resume.rb b/core/fiber/shared/resume.rb index f3477804ad..5ee27d1d24 100644 --- a/core/fiber/shared/resume.rb +++ b/core/fiber/shared/resume.rb @@ -1,7 +1,7 @@ describe :fiber_resume, shared: true do it "can be invoked from the root Fiber" do - fiber = Fiber.new { :fiber } - fiber.send(@method).should == :fiber + fiber = Fiber.new { :fiber } + fiber.send(@method).should == :fiber end it "raises a FiberError if invoked from a different Thread" do diff --git a/core/file/dirname_spec.rb b/core/file/dirname_spec.rb index 420b890550..8e6016ce6f 100644 --- a/core/file/dirname_spec.rb +++ b/core/file/dirname_spec.rb @@ -63,19 +63,19 @@ def object.to_int; 2; end end it "returns all the components of filename except the last one (edge cases on all platforms)" do - File.dirname("").should == "." - File.dirname(".").should == "." - File.dirname("./").should == "." - File.dirname("./b/./").should == "./b" - File.dirname("..").should == "." - File.dirname("../").should == "." - File.dirname("/").should == "/" - File.dirname("/.").should == "/" - File.dirname("/foo/").should == "/" - File.dirname("/foo/.").should == "/foo" - File.dirname("/foo/./").should == "/foo" - File.dirname("/foo/../.").should == "/foo/.." - File.dirname("foo/../").should == "foo" + File.dirname("").should == "." + File.dirname(".").should == "." + File.dirname("./").should == "." + File.dirname("./b/./").should == "./b" + File.dirname("..").should == "." + File.dirname("../").should == "." + File.dirname("/").should == "/" + File.dirname("/.").should == "/" + File.dirname("/foo/").should == "/" + File.dirname("/foo/.").should == "/foo" + File.dirname("/foo/./").should == "/foo" + File.dirname("/foo/../.").should == "/foo/.." + File.dirname("foo/../").should == "foo" end platform_is_not :windows do diff --git a/core/float/comparison_spec.rb b/core/float/comparison_spec.rb index d2e47937ff..0cd290f4ad 100644 --- a/core/float/comparison_spec.rb +++ b/core/float/comparison_spec.rb @@ -91,7 +91,7 @@ def obj.infinite? it "returns 1 when self is Infinity and other is infinite?=nil (which means finite)" do obj = Object.new def obj.infinite? - nil + nil end (infinity_value <=> obj).should == 1 end diff --git a/core/hash/shared/store.rb b/core/hash/shared/store.rb index dd1bb52bac..72a462a42f 100644 --- a/core/hash/shared/store.rb +++ b/core/hash/shared/store.rb @@ -91,9 +91,9 @@ def key.reverse() "bar" end end it "does not raise an exception if changing the value of an existing key during iteration" do - hash = {1 => 2, 3 => 4, 5 => 6} - hash.each { hash.send(@method, 1, :foo) } - hash.should == {1 => :foo, 3 => 4, 5 => 6} + hash = {1 => 2, 3 => 4, 5 => 6} + hash.each { hash.send(@method, 1, :foo) } + hash.should == {1 => :foo, 3 => 4, 5 => 6} end it "does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" do diff --git a/core/hash/transform_keys_spec.rb b/core/hash/transform_keys_spec.rb index 61484e0f40..f63d39ecc8 100644 --- a/core/hash/transform_keys_spec.rb +++ b/core/hash/transform_keys_spec.rb @@ -117,7 +117,7 @@ end it "raises a FrozenError on hash argument" do - ->{ @hash.transform_keys!({ a: :A, b: :B, c: :C }) }.should raise_error(FrozenError) + ->{ @hash.transform_keys!({ a: :A, b: :B, c: :C }) }.should raise_error(FrozenError) end context "when no block is given" do diff --git a/core/io/write_nonblock_spec.rb b/core/io/write_nonblock_spec.rb index c403c864fd..5bfc690f9b 100644 --- a/core/io/write_nonblock_spec.rb +++ b/core/io/write_nonblock_spec.rb @@ -43,7 +43,7 @@ it "checks if the file is writable if writing zero bytes" do -> { - @readonly_file.write_nonblock("") + @readonly_file.write_nonblock("") }.should raise_error(IOError) end end diff --git a/core/module/const_get_spec.rb b/core/module/const_get_spec.rb index 06041ddf34..4b53cbe7b3 100644 --- a/core/module/const_get_spec.rb +++ b/core/module/const_get_spec.rb @@ -131,7 +131,7 @@ end it "does read private constants" do - ConstantSpecs.const_get(:CS_PRIVATE).should == :cs_private + ConstantSpecs.const_get(:CS_PRIVATE).should == :cs_private end it 'does autoload a constant' do diff --git a/core/module/const_source_location_spec.rb b/core/module/const_source_location_spec.rb index 60d39ac55b..06b3b215c2 100644 --- a/core/module/const_source_location_spec.rb +++ b/core/module/const_source_location_spec.rb @@ -229,7 +229,7 @@ end it "does search private constants path" do - ConstantSpecs.const_source_location(:CS_PRIVATE).should == [@constants_fixture_path, ConstantSpecs::CS_PRIVATE_LINE] + ConstantSpecs.const_source_location(:CS_PRIVATE).should == [@constants_fixture_path, ConstantSpecs::CS_PRIVATE_LINE] end it "works for eval with a given line" do diff --git a/core/module/refine_spec.rb b/core/module/refine_spec.rb index 6f5fad8015..7a5d607c4f 100644 --- a/core/module/refine_spec.rb +++ b/core/module/refine_spec.rb @@ -272,7 +272,7 @@ def /(other) quo(other) end it "looks in later included modules of the refined module first" do a = Module.new do def foo - "foo from A" + "foo from A" end end diff --git a/core/numeric/shared/imag.rb b/core/numeric/shared/imag.rb index ac2da40a3b..4f117e243a 100644 --- a/core/numeric/shared/imag.rb +++ b/core/numeric/shared/imag.rb @@ -19,8 +19,8 @@ end it "raises an ArgumentError if given any arguments" do - @numbers.each do |number| - -> { number.send(@method, number) }.should raise_error(ArgumentError) - end + @numbers.each do |number| + -> { number.send(@method, number) }.should raise_error(ArgumentError) + end end end diff --git a/core/numeric/shared/rect.rb b/core/numeric/shared/rect.rb index 9cde19a398..120a69b1c4 100644 --- a/core/numeric/shared/rect.rb +++ b/core/numeric/shared/rect.rb @@ -25,24 +25,24 @@ end it "returns self as the first element" do - @numbers.each do |number| - if Float === number and number.nan? - number.send(@method).first.nan?.should be_true - else - number.send(@method).first.should == number - end - end + @numbers.each do |number| + if Float === number and number.nan? + number.send(@method).first.nan?.should be_true + else + number.send(@method).first.should == number + end + end end it "returns 0 as the last element" do - @numbers.each do |number| - number.send(@method).last.should == 0 - end + @numbers.each do |number| + number.send(@method).last.should == 0 + end end it "raises an ArgumentError if given any arguments" do - @numbers.each do |number| - -> { number.send(@method, number) }.should raise_error(ArgumentError) - end + @numbers.each do |number| + -> { number.send(@method, number) }.should raise_error(ArgumentError) + end end end diff --git a/core/process/gid_spec.rb b/core/process/gid_spec.rb index 07221da420..ca935ed520 100644 --- a/core/process/gid_spec.rb +++ b/core/process/gid_spec.rb @@ -3,8 +3,8 @@ describe "Process.gid" do platform_is_not :windows do it "returns the correct gid for the user executing this process" do - current_gid_according_to_unix = `id -gr`.to_i - Process.gid.should == current_gid_according_to_unix + current_gid_according_to_unix = `id -gr`.to_i + Process.gid.should == current_gid_according_to_unix end end diff --git a/core/string/byterindex_spec.rb b/core/string/byterindex_spec.rb index 150f709b90..34ecbfbd21 100644 --- a/core/string/byterindex_spec.rb +++ b/core/string/byterindex_spec.rb @@ -352,8 +352,8 @@ def obj.method_missing(*args); 5; end end it "returns the character index before the finish" do - "ありがりがとう".byterindex("が", 9).should == 6 - "ありがりがとう".byterindex(/が/, 9).should == 6 + "ありがりがとう".byterindex("が", 9).should == 6 + "ありがりがとう".byterindex(/が/, 9).should == 6 end end end diff --git a/core/string/chilled_string_spec.rb b/core/string/chilled_string_spec.rb index b8fb6eedc9..968e4ec1f0 100644 --- a/core/string/chilled_string_spec.rb +++ b/core/string/chilled_string_spec.rb @@ -64,7 +64,7 @@ input.freeze -> { -> { - input << "mutated" + input << "mutated" }.should raise_error(FrozenError) }.should_not complain(/literal string will be frozen in the future/) end @@ -133,7 +133,7 @@ input.freeze -> { -> { - input << "mutated" + input << "mutated" }.should raise_error(FrozenError) }.should_not complain(/string returned by :chilled\.to_s will be frozen in the future/) end diff --git a/core/string/lstrip_spec.rb b/core/string/lstrip_spec.rb index 99bab6f349..c83650207e 100644 --- a/core/string/lstrip_spec.rb +++ b/core/string/lstrip_spec.rb @@ -7,11 +7,11 @@ it_behaves_like :string_strip, :lstrip it "returns a copy of self with leading whitespace removed" do - " hello ".lstrip.should == "hello " - " hello world ".lstrip.should == "hello world " - "\n\r\t\n\v\r hello world ".lstrip.should == "hello world " - "hello".lstrip.should == "hello" - " こにちわ".lstrip.should == "こにちわ" + " hello ".lstrip.should == "hello " + " hello world ".lstrip.should == "hello world " + "\n\r\t\n\v\r hello world ".lstrip.should == "hello world " + "hello".lstrip.should == "hello" + " こにちわ".lstrip.should == "こにちわ" end it "works with lazy substrings" do @@ -22,8 +22,8 @@ end it "strips leading \\0" do - "\x00hello".lstrip.should == "hello" - "\000 \000hello\000 \000".lstrip.should == "hello\000 \000" + "\x00hello".lstrip.should == "hello" + "\000 \000hello\000 \000".lstrip.should == "hello\000 \000" end end diff --git a/core/string/rindex_spec.rb b/core/string/rindex_spec.rb index 88ce733583..0863a9c3be 100644 --- a/core/string/rindex_spec.rb +++ b/core/string/rindex_spec.rb @@ -371,8 +371,8 @@ def obj.method_missing(*args); 5; end end it "returns the character index before the finish" do - "ありがりがとう".rindex("が", 3).should == 2 - "ありがりがとう".rindex(/が/, 3).should == 2 + "ありがりがとう".rindex("が", 3).should == 2 + "ありがりがとう".rindex(/が/, 3).should == 2 end it "raises an Encoding::CompatibilityError if the encodings are incompatible" do diff --git a/core/string/scan_spec.rb b/core/string/scan_spec.rb index 70c3b7fb7b..bbe843b591 100644 --- a/core/string/scan_spec.rb +++ b/core/string/scan_spec.rb @@ -103,11 +103,11 @@ offsets = [] str.scan(/([aeiou])/) do - md = $~ - md.string.should == str - matches << md.to_a - offsets << md.offset(0) - str + md = $~ + md.string.should == str + matches << md.to_a + offsets << md.offset(0) + str end matches.should == [["e", "e"], ["o", "o"]] @@ -117,11 +117,11 @@ offsets = [] str.scan("l") do - md = $~ - md.string.should == str - matches << md.to_a - offsets << md.offset(0) - str + md = $~ + md.string.should == str + matches << md.to_a + offsets << md.offset(0) + str end matches.should == [["l"], ["l"]] diff --git a/core/string/sub_spec.rb b/core/string/sub_spec.rb index 4f9f87a433..6ff28ec851 100644 --- a/core/string/sub_spec.rb +++ b/core/string/sub_spec.rb @@ -232,10 +232,10 @@ offsets = [] str.sub(/([aeiou])/) do - md = $~ - md.string.should == str - offsets << md.offset(0) - str + md = $~ + md.string.should == str + offsets << md.offset(0) + str end.should == "hhellollo" offsets.should == [[1, 2]] @@ -339,10 +339,10 @@ offsets = [] str.dup.sub!(/([aeiou])/) do - md = $~ - md.string.should == str - offsets << md.offset(0) - str + md = $~ + md.string.should == str + offsets << md.offset(0) + str end.should == "hhellollo" offsets.should == [[1, 2]] diff --git a/core/string/swapcase_spec.rb b/core/string/swapcase_spec.rb index 7f4c68366d..011a213501 100644 --- a/core/string/swapcase_spec.rb +++ b/core/string/swapcase_spec.rb @@ -5,9 +5,9 @@ describe "String#swapcase" do it "returns a new string with all uppercase chars from self converted to lowercase and vice versa" do - "Hello".swapcase.should == "hELLO" - "cYbEr_PuNk11".swapcase.should == "CyBeR_pUnK11" - "+++---111222???".swapcase.should == "+++---111222???" + "Hello".swapcase.should == "hELLO" + "cYbEr_PuNk11".swapcase.should == "CyBeR_pUnK11" + "+++---111222???".swapcase.should == "+++---111222???" end it "returns a String in the same encoding as self" do diff --git a/core/string/to_f_spec.rb b/core/string/to_f_spec.rb index 1d2488283e..72e2a90b13 100644 --- a/core/string/to_f_spec.rb +++ b/core/string/to_f_spec.rb @@ -5,15 +5,15 @@ describe "String#to_f" do it "treats leading characters of self as a floating point number" do - "123.45e1".to_f.should == 1234.5 - "45.67 degrees".to_f.should == 45.67 - "0".to_f.should == 0.0 - - ".5".to_f.should == 0.5 - ".5e1".to_f.should == 5.0 - "5.".to_f.should == 5.0 - "5e".to_f.should == 5.0 - "5E".to_f.should == 5.0 + "123.45e1".to_f.should == 1234.5 + "45.67 degrees".to_f.should == 45.67 + "0".to_f.should == 0.0 + + ".5".to_f.should == 0.5 + ".5e1".to_f.should == 5.0 + "5.".to_f.should == 5.0 + "5e".to_f.should == 5.0 + "5E".to_f.should == 5.0 end it "treats special float value strings as characters" do diff --git a/core/symbol/shared/slice.rb b/core/symbol/shared/slice.rb index 0df87e183d..d3d4aad617 100644 --- a/core/symbol/shared/slice.rb +++ b/core/symbol/shared/slice.rb @@ -7,7 +7,7 @@ end it "returns nil if the index starts from the end and is greater than the length" do - :symbol.send(@method, -10).should be_nil + :symbol.send(@method, -10).should be_nil end it "returns nil if the index is greater than the length" do diff --git a/core/thread/abort_on_exception_spec.rb b/core/thread/abort_on_exception_spec.rb index 34b648ca0f..49be84ea9f 100644 --- a/core/thread/abort_on_exception_spec.rb +++ b/core/thread/abort_on_exception_spec.rb @@ -72,7 +72,7 @@ end after do - Thread.abort_on_exception = @abort_on_exception + Thread.abort_on_exception = @abort_on_exception end it "is false by default" do diff --git a/core/unboundmethod/source_location_spec.rb b/core/unboundmethod/source_location_spec.rb index 45bd69438c..2391d07d99 100644 --- a/core/unboundmethod/source_location_spec.rb +++ b/core/unboundmethod/source_location_spec.rb @@ -61,5 +61,5 @@ ruby_version_is("3.5") do location.should == ["foo", 100, 0, 100, 10] end - end + end end diff --git a/language/private_spec.rb b/language/private_spec.rb index ddf185e6d2..b04aa25c9e 100644 --- a/language/private_spec.rb +++ b/language/private_spec.rb @@ -34,7 +34,7 @@ it "changes visibility of previously called method" do klass = Class.new do def foo - "foo" + "foo" end end f = klass.new diff --git a/language/proc_spec.rb b/language/proc_spec.rb index cc69b7799c..ca9a13aa61 100644 --- a/language/proc_spec.rb +++ b/language/proc_spec.rb @@ -104,7 +104,7 @@ end it "assigns all passed values after the first to the rest argument" do - @l.call(1, 2, 3).should == [1, [2, 3]] + @l.call(1, 2, 3).should == [1, [2, 3]] end it "does not call #to_ary to convert a single passed object to an Array" do diff --git a/language/regexp/anchors_spec.rb b/language/regexp/anchors_spec.rb index 0129e255da..cdc06c0b4d 100644 --- a/language/regexp/anchors_spec.rb +++ b/language/regexp/anchors_spec.rb @@ -124,10 +124,10 @@ /foo\b/.match("foo").to_a.should == ["foo"] /foo\b/.match("foo\n").to_a.should == ["foo"] LanguageSpecs.white_spaces.scan(/./).each do |c| - /foo\b/.match("foo" + c).to_a.should == ["foo"] + /foo\b/.match("foo" + c).to_a.should == ["foo"] end LanguageSpecs.non_alphanum_non_space.scan(/./).each do |c| - /foo\b/.match("foo" + c).to_a.should == ["foo"] + /foo\b/.match("foo" + c).to_a.should == ["foo"] end /foo\b/.match("foo\0").to_a.should == ["foo"] # Basic non-matching @@ -145,10 +145,10 @@ /foo\B/.match("foo").should be_nil /foo\B/.match("foo\n").should be_nil LanguageSpecs.white_spaces.scan(/./).each do |c| - /foo\B/.match("foo" + c).should be_nil + /foo\B/.match("foo" + c).should be_nil end LanguageSpecs.non_alphanum_non_space.scan(/./).each do |c| - /foo\B/.match("foo" + c).should be_nil + /foo\B/.match("foo" + c).should be_nil end /foo\B/.match("foo\0").should be_nil end diff --git a/language/regexp/character_classes_spec.rb b/language/regexp/character_classes_spec.rb index 98d431a817..8e9a0b960b 100644 --- a/language/regexp/character_classes_spec.rb +++ b/language/regexp/character_classes_spec.rb @@ -226,7 +226,7 @@ end it "matches Unicode letter characters with [[:graph:]]" do - "à".match(/[[:graph:]]/).to_a.should == ["à"] + "à".match(/[[:graph:]]/).to_a.should == ["à"] end it "matches Unicode digits with [[:graph:]]" do diff --git a/language/regexp/grouping_spec.rb b/language/regexp/grouping_spec.rb index 2f04a04018..313858f714 100644 --- a/language/regexp/grouping_spec.rb +++ b/language/regexp/grouping_spec.rb @@ -12,7 +12,7 @@ end it "raises a SyntaxError when parentheses aren't balanced" do - -> { eval "/(hay(st)ack/" }.should raise_error(SyntaxError) + -> { eval "/(hay(st)ack/" }.should raise_error(SyntaxError) end it "supports (?: ) (non-capturing group)" do diff --git a/language/undef_spec.rb b/language/undef_spec.rb index 29dba4afb4..268c0b84c3 100644 --- a/language/undef_spec.rb +++ b/language/undef_spec.rb @@ -69,7 +69,7 @@ def method2; :nope; end it "raises a NameError when passed a missing name" do Class.new do -> { - undef not_exist + undef not_exist }.should raise_error(NameError) { |e| # a NameError and not a NoMethodError e.class.should == NameError diff --git a/library/bigdecimal/split_spec.rb b/library/bigdecimal/split_spec.rb index f9b4bab5f7..53b1f649d9 100644 --- a/library/bigdecimal/split_spec.rb +++ b/library/bigdecimal/split_spec.rb @@ -58,16 +58,16 @@ end it "third value: the base (currently always ten)" do - @arr[2].should == 10 - @arr_neg[2].should == 10 - @arr_big[2].should == 10 - @arr_big_neg[2].should == 10 - @huge[2].should == 10 - @infinity.split[2].should == 10 - @nan.split[2].should == 10 - @infinity_neg.split[2].should == 10 - @zero.split[2].should == 10 - @zero_neg.split[2].should == 10 + @arr[2].should == 10 + @arr_neg[2].should == 10 + @arr_big[2].should == 10 + @arr_big_neg[2].should == 10 + @huge[2].should == 10 + @infinity.split[2].should == 10 + @nan.split[2].should == 10 + @infinity_neg.split[2].should == 10 + @zero.split[2].should == 10 + @zero_neg.split[2].should == 10 end it "fourth value: the exponent" do diff --git a/library/bigdecimal/to_i_spec.rb b/library/bigdecimal/to_i_spec.rb index 09481fce15..e5e65c562e 100644 --- a/library/bigdecimal/to_i_spec.rb +++ b/library/bigdecimal/to_i_spec.rb @@ -3,5 +3,5 @@ require 'bigdecimal' describe "BigDecimal#to_i" do - it_behaves_like :bigdecimal_to_int, :to_i + it_behaves_like :bigdecimal_to_int, :to_i end diff --git a/library/bigdecimal/truncate_spec.rb b/library/bigdecimal/truncate_spec.rb index 4ad9eb92d1..0ae0421b30 100644 --- a/library/bigdecimal/truncate_spec.rb +++ b/library/bigdecimal/truncate_spec.rb @@ -4,11 +4,11 @@ describe "BigDecimal#truncate" do before :each do - @arr = ['3.14159', '8.7', "0.314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043E1"] - @big = BigDecimal("123456.789") - @nan = BigDecimal('NaN') - @infinity = BigDecimal('Infinity') - @infinity_negative = BigDecimal('-Infinity') + @arr = ['3.14159', '8.7', "0.314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593014782083152134043E1"] + @big = BigDecimal("123456.789") + @nan = BigDecimal('NaN') + @infinity = BigDecimal('Infinity') + @infinity_negative = BigDecimal('-Infinity') end it "returns value of type Integer." do diff --git a/library/digest/md5/append_spec.rb b/library/digest/md5/append_spec.rb index a7f841c883..0abdc074a1 100644 --- a/library/digest/md5/append_spec.rb +++ b/library/digest/md5/append_spec.rb @@ -3,5 +3,5 @@ require_relative 'shared/update' describe "Digest::MD5#<<" do - it_behaves_like :md5_update, :<< + it_behaves_like :md5_update, :<< end diff --git a/library/digest/sha256/append_spec.rb b/library/digest/sha256/append_spec.rb index 9ca3496afc..ab594c105f 100644 --- a/library/digest/sha256/append_spec.rb +++ b/library/digest/sha256/append_spec.rb @@ -3,5 +3,5 @@ require_relative 'shared/update' describe "Digest::SHA256#<<" do - it_behaves_like :sha256_update, :<< + it_behaves_like :sha256_update, :<< end diff --git a/library/digest/sha384/append_spec.rb b/library/digest/sha384/append_spec.rb index 2bc0c5b90b..94c036cc3f 100644 --- a/library/digest/sha384/append_spec.rb +++ b/library/digest/sha384/append_spec.rb @@ -3,5 +3,5 @@ require_relative 'shared/update' describe "Digest::SHA384#<<" do - it_behaves_like :sha384_update, :<< + it_behaves_like :sha384_update, :<< end diff --git a/library/digest/sha512/append_spec.rb b/library/digest/sha512/append_spec.rb index e5f84b56f4..9106e9685d 100644 --- a/library/digest/sha512/append_spec.rb +++ b/library/digest/sha512/append_spec.rb @@ -3,5 +3,5 @@ require_relative 'shared/update' describe "Digest::SHA512#<<" do - it_behaves_like :sha512_update, :<< + it_behaves_like :sha512_update, :<< end diff --git a/library/io-wait/wait_spec.rb b/library/io-wait/wait_spec.rb index 61356ff395..6ab41e9f08 100644 --- a/library/io-wait/wait_spec.rb +++ b/library/io-wait/wait_spec.rb @@ -156,7 +156,7 @@ end it "accepts a list of modes" do - @io.wait(0, :r, :w, :rw).should == @io + @io.wait(0, :r, :w, :rw).should == @io end # It works at least since 2.7 but by some reason may fail on 3.1 diff --git a/library/logger/logger/new_spec.rb b/library/logger/logger/new_spec.rb index 6dcb030ae1..3db20e7432 100644 --- a/library/logger/logger/new_spec.rb +++ b/library/logger/logger/new_spec.rb @@ -28,9 +28,9 @@ end it "receives a frequency rotation as second argument" do - -> { Logger.new(@log_file, "daily") }.should_not raise_error - -> { Logger.new(@log_file, "weekly") }.should_not raise_error - -> { Logger.new(@log_file, "monthly") }.should_not raise_error + -> { Logger.new(@log_file, "daily") }.should_not raise_error + -> { Logger.new(@log_file, "weekly") }.should_not raise_error + -> { Logger.new(@log_file, "monthly") }.should_not raise_error end it "also receives a number of log files to keep as second argument" do diff --git a/library/socket/basicsocket/send_spec.rb b/library/socket/basicsocket/send_spec.rb index 1c028480e3..36da125279 100644 --- a/library/socket/basicsocket/send_spec.rb +++ b/library/socket/basicsocket/send_spec.rb @@ -62,25 +62,25 @@ end it "accepts a sockaddr as recipient address" do - data = +"" - t = Thread.new do - client = @server.accept - loop do - got = client.recv(5) - break if got.nil? || got.empty? - data << got - end - client.close - end - Thread.pass while t.status and t.status != "sleep" - t.status.should_not be_nil - - sockaddr = Socket.pack_sockaddr_in(@port, "127.0.0.1") - @socket.send('hello', 0, sockaddr).should == 5 - @socket.shutdown # indicate, that we are done sending - - t.join - data.should == 'hello' + data = +"" + t = Thread.new do + client = @server.accept + loop do + got = client.recv(5) + break if got.nil? || got.empty? + data << got + end + client.close + end + Thread.pass while t.status and t.status != "sleep" + t.status.should_not be_nil + + sockaddr = Socket.pack_sockaddr_in(@port, "127.0.0.1") + @socket.send('hello', 0, sockaddr).should == 5 + @socket.shutdown # indicate, that we are done sending + + t.join + data.should == 'hello' end end diff --git a/library/socket/socket/bind_spec.rb b/library/socket/socket/bind_spec.rb index 4465a3dafa..e76336eafa 100644 --- a/library/socket/socket/bind_spec.rb +++ b/library/socket/socket/bind_spec.rb @@ -122,7 +122,7 @@ -> { @socket.bind(sockaddr1) }.should raise_error(Errno::EACCES) end - end + end end end diff --git a/library/stringscanner/must_C_version_spec.rb b/library/stringscanner/must_C_version_spec.rb index fcc5b596f6..9d6edfe7b6 100644 --- a/library/stringscanner/must_C_version_spec.rb +++ b/library/stringscanner/must_C_version_spec.rb @@ -3,6 +3,6 @@ describe "StringScanner.must_C_version" do it "returns self" do - StringScanner.must_C_version.should == StringScanner + StringScanner.must_C_version.should == StringScanner end end diff --git a/library/stringscanner/terminate_spec.rb b/library/stringscanner/terminate_spec.rb index 249023f1ab..7943efe0f9 100644 --- a/library/stringscanner/terminate_spec.rb +++ b/library/stringscanner/terminate_spec.rb @@ -3,5 +3,5 @@ require 'strscan' describe "StringScanner#terminate" do - it_behaves_like :strscan_terminate, :terminate + it_behaves_like :strscan_terminate, :terminate end diff --git a/optional/capi/encoding_spec.rb b/optional/capi/encoding_spec.rb index 1529e012b0..db693f041b 100644 --- a/optional/capi/encoding_spec.rb +++ b/optional/capi/encoding_spec.rb @@ -171,7 +171,7 @@ describe "rb_enc_mbc_to_codepoint" do it "returns the correct codepoint for the given character and size" do - @s.rb_enc_mbc_to_codepoint("é").should == 0xE9 + @s.rb_enc_mbc_to_codepoint("é").should == 0xE9 end it "returns 0 if p == e" do diff --git a/optional/capi/regexp_spec.rb b/optional/capi/regexp_spec.rb index af366e17a2..4b130ff66a 100644 --- a/optional/capi/regexp_spec.rb +++ b/optional/capi/regexp_spec.rb @@ -77,7 +77,7 @@ end it "returns MatchData when used with rb_reg_match" do - @p.rb_reg_match_backref_get(/a/, 'ab')[0].should == 'a' + @p.rb_reg_match_backref_get(/a/, 'ab')[0].should == 'a' end end diff --git a/optional/capi/string_spec.rb b/optional/capi/string_spec.rb index 801d50f117..18eaeda8e0 100644 --- a/optional/capi/string_spec.rb +++ b/optional/capi/string_spec.rb @@ -1012,7 +1012,7 @@ def inspect result = @s.rb_str_export_to_enc(source, Encoding::UTF_8) source.bytes.should == [0, 255] end -end + end describe "rb_sprintf" do it "replaces the parts like sprintf" do diff --git a/shared/file/size.rb b/shared/file/size.rb index 880dfbb612..cba99fe6a5 100644 --- a/shared/file/size.rb +++ b/shared/file/size.rb @@ -72,7 +72,7 @@ end it "returns nil if file_name doesn't exist or has 0 size" do - @object.send(@method, @missing).should == nil + @object.send(@method, @missing).should == nil end end