Skip to content

Commit a10ff97

Browse files
committed
util/rubocop -a
1 parent 26d6adc commit a10ff97

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

lib/rubygems/test_case.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,12 +1558,12 @@ def self.key_path(key_name)
15581558
end
15591559

15601560
class Object
1561-
def stub name, val_or_callable, *block_args
1561+
def stub(name, val_or_callable, *block_args)
15621562
new_name = "__minitest_stub__#{name}"
15631563

15641564
metaclass = class << self; self; end
15651565

1566-
if respond_to? name and not methods.map(&:to_s).include? name.to_s then
1566+
if respond_to? name and not methods.map(&:to_s).include? name.to_s
15671567
metaclass.send :define_method, name do |*args|
15681568
super(*args)
15691569
end
@@ -1572,7 +1572,7 @@ def stub name, val_or_callable, *block_args
15721572
metaclass.send :alias_method, new_name, name
15731573

15741574
metaclass.send :define_method, name do |*args, &blk|
1575-
if val_or_callable.respond_to? :call then
1575+
if val_or_callable.respond_to? :call
15761576
val_or_callable.call(*args, &blk)
15771577
else
15781578
blk.call(*block_args) if blk

test/rubygems/test_gem_commands_help_command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_gem_help_commands
4848
if Gem::HAVE_OPENSSL
4949
assert_empty err
5050

51-
refute_match %r|No command found for |, out
51+
refute_match %r{No command found for }, out
5252
end
5353
end
5454
end

test/rubygems/test_gem_package_tar_writer.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ def test_add_file_signer_empty
148148
end
149149

150150
def test_add_file_simple
151-
@tar_writer.add_file_simple 'x', 0644, 10 do |io|
152-
io.write "a" * 10
153-
end
151+
@tar_writer.add_file_simple 'x', 0644, 10 do |io|
152+
io.write "a" * 10
153+
end
154154

155-
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
156-
@io.string[0, 512])
155+
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
156+
@io.string[0, 512])
157157

158158
assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
159159
assert_equal 1024, @io.pos
@@ -170,10 +170,10 @@ def test_add_file_simple_source_date_epoch
170170
end
171171

172172
def test_add_file_simple_padding
173-
@tar_writer.add_file_simple 'x', 0, 100
173+
@tar_writer.add_file_simple 'x', 0, 100
174174

175-
assert_headers_equal tar_file_header('x', '', 0, 100, Time.now),
176-
@io.string[0, 512]
175+
assert_headers_equal tar_file_header('x', '', 0, 100, Time.now),
176+
@io.string[0, 512]
177177

178178
assert_equal "\0" * 512, @io.string[512, 512]
179179
end

test/rubygems/test_gem_request_set.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_install_from_gemdeps_explain
8787
a-2
8888
EXPECTED
8989

90-
actual, _= capture_output do
90+
actual, _ = capture_output do
9191
rs.install_from_gemdeps :gemdeps => io.path, :explain => true
9292
end
9393
assert_equal(expected, actual)

test/rubygems/test_gem_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,7 @@ def test_to_ruby_platform
26192619
def test_to_yaml
26202620
yaml_str = @a1.to_yaml
26212621

2622-
refute_match %r|!!null|, yaml_str
2622+
refute_match %r{!!null}, yaml_str
26232623

26242624
same_spec = Gem::Specification.from_yaml(yaml_str)
26252625

test/rubygems/test_remote_fetch_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class TestRemoteFetchError < Gem::TestCase
55
def test_password_redacted
66
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:[email protected]')
7-
refute_match %r|secret|, error.to_s
7+
refute_match %r{secret}, error.to_s
88
end
99

1010
def test_invalid_url

0 commit comments

Comments
 (0)