Skip to content

Commit

Permalink
Rubocop: enable Layout/EmptyLinesAroundBlockBody
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Feb 11, 2025
1 parent 03278d0 commit 517f875
Show file tree
Hide file tree
Showing 401 changed files with 3 additions and 667 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ AllCops:
DisabledByDefault: true
NewCops: disable

Layout/EmptyLinesAroundBlockBody:
Enabled: true

Layout/IndentationConsistency:
Enabled: true

Expand Down
1 change: 0 additions & 1 deletion command_line/dash_s_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@
ruby_exe(@script, options: "-s",
args: "----name--test--=blah 3").chomp.should == "blah"
end

end
end
1 change: 0 additions & 1 deletion command_line/feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@
ruby_exe("p 14", options: "--enable-ruby-spec-feature-does-not-exist 2>&1").chomp.should include('warning: unknown argument for --enable')
ruby_exe("p 14", options: "--disable-ruby-spec-feature-does-not-exist 2>&1").chomp.should include('warning: unknown argument for --disable')
end

end
3 changes: 0 additions & 3 deletions command_line/frozen_strings_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../spec_helper'

describe "The --enable-frozen-string-literal flag causes string literals to" do

it "produce the same object each time" do
ruby_exe(fixture(__FILE__, "freeze_flag_one_literal.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
end
Expand All @@ -20,11 +19,9 @@
end

describe "The --disable-frozen-string-literal flag causes string literals to" do

it "produce a different object each time" do
ruby_exe(fixture(__FILE__, "freeze_flag_one_literal.rb"), options: "--disable-frozen-string-literal").chomp.should == "false"
end

end

describe "With neither --enable-frozen-string-literal nor --disable-frozen-string-literal flag set" do
Expand Down
1 change: 0 additions & 1 deletion core/argf/gets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@
@argf.gets.encoding.should == Encoding::US_ASCII
end
end

end
2 changes: 0 additions & 2 deletions core/array/bsearch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

it "returns element at zero if the block returns true for every element" do
[0, 1, 2, 3].bsearch { |x| x < 4 }.should == 0

end

it "returns the element at the smallest index for which block returns true" do
Expand All @@ -43,7 +42,6 @@

it "returns nil if the block returns greater than zero for every element" do
[0, 1, 2, 3].bsearch { |x| x <=> -1 }.should be_nil

end

it "returns nil if the block never returns zero" do
Expand Down
2 changes: 0 additions & 2 deletions core/array/dig_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../spec_helper'

describe "Array#dig" do

it "returns #at with one arg" do
['a'].dig(0).should == 'a'
['a'].dig(1).should be_nil
Expand Down Expand Up @@ -48,5 +47,4 @@
h[0].should_receive(:dig).with(1, 2).and_return(42)
h.dig(0, 1, 2).should == 42
end

end
1 change: 0 additions & 1 deletion core/array/element_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ def obj.to_ary() [1, 2, 3] end
a[4] = 8
a.should == [1, 2, 3, 4, 8]
end

end

describe "Array#[]= with [index, count]" do
Expand Down
1 change: 0 additions & 1 deletion core/array/max_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,4 @@
multi = [[1,2], [3,4,5], [6,7,8,9]]
multi.max.should == [6, 7, 8, 9]
end

end
1 change: 0 additions & 1 deletion core/array/min_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@
multi = [[1,2], [3,4,5], [6,7,8,9]]
multi.min.should == [1, 2]
end

end
1 change: 0 additions & 1 deletion core/array/permutation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


describe "Array#permutation" do

before :each do
@numbers = (1..3).to_a
@yielded = []
Expand Down
1 change: 0 additions & 1 deletion core/array/repeated_permutation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


describe "Array#repeated_permutation" do

before :each do
@numbers = [10, 11, 12]
@permutations = [[10, 10], [10, 11], [10, 12], [11, 10], [11, 11], [11, 12], [12, 10], [12, 11], [12, 12]]
Expand Down
1 change: 0 additions & 1 deletion core/array/to_ary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
array = ArraySpecs.recursive_array
array.to_ary.should == array
end

end
1 change: 0 additions & 1 deletion core/array/uniq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def obj.eql?(o)
describe "given an array of BasicObject subclasses that define ==, eql?, and hash" do
# jruby/jruby#3227
it "filters equivalent elements using those definitions" do

basic = Class.new(BasicObject) do
attr_reader :x

Expand Down
1 change: 0 additions & 1 deletion core/basicobject/instance_eval_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def foo
"hola".instance_eval("size").should == 4
Object.class_eval { "hola".instance_eval("to_s") }.should == "hola"
Object.class_eval { "Ruby-fu".instance_eval{ to_s } }.should == "Ruby-fu"

end

ruby_version_is "3.3" do
Expand Down
1 change: 0 additions & 1 deletion core/binding/local_variable_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@
-> { bind.local_variable_set(:$~, "") }.should raise_error(NameError)
-> { bind.local_variable_set(:$_, "") }.should raise_error(NameError)
end

end
2 changes: 0 additions & 2 deletions core/class/inherited_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative 'fixtures/classes'

describe "Class.inherited" do

before :each do
ScratchPad.record nil
end
Expand Down Expand Up @@ -97,5 +96,4 @@ class << top; private :inherited; end
class << top; protected :inherited; end
-> { Class.new(top) }.should_not raise_error
end

end
2 changes: 0 additions & 2 deletions core/encoding/compatible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
# BINARY encodings (as most common) as well as an ASCII-compatible, a non-ASCII-compatible and a dummy
# encodings in all possible combinations.
describe "compatibility matrix" do

# Use the following script to regenerate the matrix:
#
# ```
Expand Down Expand Up @@ -618,7 +617,6 @@
str = "abc".dup.force_encoding("us-ascii")
Encoding.compatible?(/abc/, str).should == Encoding::US_ASCII
end

end

describe "Encoding.compatible? Regexp, Regexp" do
Expand Down
1 change: 0 additions & 1 deletion core/enumerable/cycle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@
end
it_should_behave_like :enumeratorized_with_unknown_size
end

end
1 change: 0 additions & 1 deletion core/enumerable/drop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@
->{ @enum.drop("hat") }.should raise_error(TypeError)
->{ @enum.drop(nil) }.should raise_error(TypeError)
end

end
end
1 change: 0 additions & 1 deletion core/enumerable/each_slice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,4 @@
it_should_behave_like :enumeratorized_with_unknown_size
end
end

end
1 change: 0 additions & 1 deletion core/enumerable/each_with_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_relative 'shared/enumerable_enumeratorized'

describe "Enumerable#each_with_index" do

before :each do
@b = EnumerableSpecs::Numerous.new(2, 5, 3, 6, 1, 4)
end
Expand Down
1 change: 0 additions & 1 deletion core/enumerable/shared/include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ class EnumerableSpecIncludeP11; def ==(obj); obj == '11'; end; end
multi = EnumerableSpecs::YieldsMulti.new
multi.send(@method, [1,2]).should be_true
end

end
1 change: 0 additions & 1 deletion core/enumerable/zip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative 'fixtures/classes'

describe "Enumerable#zip" do

it "combines each element of the receiver with the element of the same index in arrays given as arguments" do
EnumerableSpecs::Numerous.new(1,2,3).zip([4,5,6],[7,8,9]).should == [[1,4,7],[2,5,8],[3,6,9]]
EnumerableSpecs::Numerous.new(1,2,3).zip.should == [[1],[2],[3]]
Expand Down
1 change: 0 additions & 1 deletion core/enumerator/lazy/chunk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require_relative 'fixtures/classes'

describe "Enumerator::Lazy#chunk" do

before :each do
@yieldsmixed = EnumeratorLazySpecs::YieldsMixed.new.to_enum.lazy
@eventsmixed = EnumeratorLazySpecs::EventsMixed.new.to_enum.lazy
Expand Down
1 change: 0 additions & 1 deletion core/enumerator/shared/with_index.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../../spec_helper'

describe :enum_with_index, shared: true do

require_relative '../fixtures/classes'

before :each do
Expand Down
1 change: 0 additions & 1 deletion core/env/clear_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
ENV.replace orig
end
end

end
1 change: 0 additions & 1 deletion core/env/each_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative '../enumerable/shared/enumeratorized'

describe "ENV.each_key" do

it "returns each key" do
e = []
orig = ENV.to_hash
Expand Down
1 change: 0 additions & 1 deletion core/env/each_value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative '../enumerable/shared/enumeratorized'

describe "ENV.each_value" do

it "returns each value" do
e = []
orig = ENV.to_hash
Expand Down
1 change: 0 additions & 1 deletion core/env/empty_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../spec_helper'

describe "ENV.empty?" do

it "returns true if the Environment is empty" do
if ENV.keys.size > 0
ENV.should_not.empty?
Expand Down
2 changes: 0 additions & 2 deletions core/env/inspect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
require_relative '../../spec_helper'

describe "ENV.inspect" do

it "returns a String that looks like a Hash with real data" do
ENV["foo"] = "bar"
ENV.inspect.should =~ /\{.*"foo" *=> *"bar".*\}/
ENV.delete "foo"
end

end
1 change: 0 additions & 1 deletion core/env/keys_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../spec_helper'

describe "ENV.keys" do

it "returns an array of the keys" do
ENV.keys.should == ENV.to_hash.keys
end
Expand Down
1 change: 0 additions & 1 deletion core/env/to_a_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative 'spec_helper'

describe "ENV.to_a" do

it "returns the ENV as an array" do
a = ENV.to_a
a.is_a?(Array).should == true
Expand Down
1 change: 0 additions & 1 deletion core/env/values_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative 'spec_helper'

describe "ENV.values" do

it "returns an array of the values" do
ENV.values.should == ENV.to_hash.values
end
Expand Down
1 change: 0 additions & 1 deletion core/exception/shared/new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
it "returns the exception when it has a custom constructor" do
ExceptionSpecs::ConstructorException.send(@method).should be_kind_of(ExceptionSpecs::ConstructorException)
end

end
1 change: 0 additions & 1 deletion core/file/basename_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,4 @@
end
end
end

end
1 change: 0 additions & 1 deletion core/file/constants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,4 @@
File::PATH_SEPARATOR.should == ":"
end
end

end
1 change: 0 additions & 1 deletion core/file/extname_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@
it "returns the extension for a multibyte filename" do
File.extname('Имя.m4a').should == ".m4a"
end

end
1 change: 0 additions & 1 deletion core/file/lstat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
end

describe "File.lstat" do

before :each do
@file = tmp('i_exist')
@link = tmp('i_am_a_symlink')
Expand Down
1 change: 0 additions & 1 deletion core/file/mtime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@
it "returns the modification Time of the file" do
@f.mtime.should be_kind_of(Time)
end

end
1 change: 0 additions & 1 deletion core/file/owned_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@
end
end
end

end
1 change: 0 additions & 1 deletion core/file/size_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
end

describe "File#size" do

before :each do
@name = tmp('i_exist')
touch(@name) { |f| f.write 'rubinius' }
Expand Down
1 change: 0 additions & 1 deletion core/file/stat/inspect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../../spec_helper'

describe "File::Stat#inspect" do

before :each do
@file = tmp('i_exist')
touch(@file) { |f| f.write "rubinius" }
Expand Down
1 change: 0 additions & 1 deletion core/file/stat/new_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../../../spec_helper'

describe "File::Stat#initialize" do

before :each do
@file = tmp('i_exist')
touch(@file) { |f| f.write "rubinius" }
Expand Down
1 change: 0 additions & 1 deletion core/file/stat/pipe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@
rm_r filename
end
end

end
1 change: 0 additions & 1 deletion core/float/numerator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@
it "returns -Infinity for -Infinity" do
(-infinity_value).numerator.infinite?.should == -1
end

end
1 change: 0 additions & 1 deletion core/float/rationalize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
f = -f
f.rationalize(Rational(1,10)).should == Rational(-1,3)
f.rationalize(Rational(-1,10)).should == Rational(-1,3)

end

it "simplifies self to the degree specified by a Float argument" do
Expand Down
1 change: 0 additions & 1 deletion core/gc/disable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
GC.disable.should == false
GC.disable.should == true
end

end
Loading

0 comments on commit 517f875

Please sign in to comment.