aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_stream_ui.rb
diff options
context:
space:
mode:
authorTakuya Noguchi <takninnovationresearch@gmail.com>2022-07-17 08:08:51 +0000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-07-22 12:07:23 +0900
commitd7ffd3fea402239b16833cc434404a7af82d44f3 (patch)
tree9794942135111c36e6b6bce69e070ca556b89028 /test/rubygems/test_gem_stream_ui.rb
parent388c4e1076ac5a58d5008abc8e0a8d017698875a (diff)
downloadruby-d7ffd3fea402239b16833cc434404a7af82d44f3.tar.gz
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Diffstat (limited to 'test/rubygems/test_gem_stream_ui.rb')
-rw-r--r--test/rubygems/test_gem_stream_ui.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/rubygems/test_gem_stream_ui.rb b/test/rubygems/test_gem_stream_ui.rb
index 04de6dd36a..3dbc346271 100644
--- a/test/rubygems/test_gem_stream_ui.rb
+++ b/test/rubygems/test_gem_stream_ui.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require_relative 'helper'
-require 'rubygems/user_interaction'
-require 'timeout'
+require_relative "helper"
+require "rubygems/user_interaction"
+require "timeout"
class TestGemStreamUI < Gem::TestCase
# increase timeout with MJIT for --jit-wait testing
@@ -100,14 +100,14 @@ class TestGemStreamUI < Gem::TestCase
@in.puts "1"
@in.rewind
- result = @sui.choose_from_list 'which one?', %w[foo bar]
+ result = @sui.choose_from_list "which one?", %w[foo bar]
- assert_equal ['foo', 0], result
+ assert_equal ["foo", 0], result
assert_equal "which one?\n 1. foo\n 2. bar\n> ", @out.string
end
def test_choose_from_list_EOF
- result = @sui.choose_from_list 'which one?', %w[foo bar]
+ result = @sui.choose_from_list "which one?", %w[foo bar]
assert_equal [nil, nil], result
assert_equal "which one?\n 1. foo\n 2. bar\n> ", @out.string
@@ -115,27 +115,27 @@ class TestGemStreamUI < Gem::TestCase
def test_progress_reporter_silent_nil
@cfg.verbose = nil
- reporter = @sui.progress_reporter 10, 'hi'
+ reporter = @sui.progress_reporter 10, "hi"
assert_kind_of Gem::StreamUI::SilentProgressReporter, reporter
end
def test_progress_reporter_silent_false
@cfg.verbose = false
- reporter = @sui.progress_reporter 10, 'hi'
+ reporter = @sui.progress_reporter 10, "hi"
assert_kind_of Gem::StreamUI::SilentProgressReporter, reporter
assert_equal "", @out.string
end
def test_progress_reporter_simple
@cfg.verbose = true
- reporter = @sui.progress_reporter 10, 'hi'
+ reporter = @sui.progress_reporter 10, "hi"
assert_kind_of Gem::StreamUI::SimpleProgressReporter, reporter
assert_equal "hi\n", @out.string
end
def test_progress_reporter_verbose
@cfg.verbose = 0
- reporter = @sui.progress_reporter 10, 'hi'
+ reporter = @sui.progress_reporter 10, "hi"
assert_kind_of Gem::StreamUI::VerboseProgressReporter, reporter
assert_equal "hi\n", @out.string
end
@@ -143,7 +143,7 @@ class TestGemStreamUI < Gem::TestCase
def test_download_reporter_silent_nil
@cfg.verbose = nil
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
assert_kind_of Gem::StreamUI::SilentDownloadReporter, reporter
assert_equal "", @out.string
end
@@ -151,7 +151,7 @@ class TestGemStreamUI < Gem::TestCase
def test_download_reporter_silent_false
@cfg.verbose = false
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
assert_kind_of Gem::StreamUI::SilentDownloadReporter, reporter
assert_equal "", @out.string
end
@@ -165,14 +165,14 @@ class TestGemStreamUI < Gem::TestCase
def test_threaded_download_reporter
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
assert_equal "Fetching a.gem\n", @out.string
end
def test_verbose_download_reporter_progress
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
reporter.update 512
assert_equal "Fetching a.gem\n", @out.string
end
@@ -180,7 +180,7 @@ class TestGemStreamUI < Gem::TestCase
def test_verbose_download_reporter_progress_once
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
reporter.update 510
reporter.update 512
assert_equal "Fetching a.gem\n", @out.string
@@ -189,7 +189,7 @@ class TestGemStreamUI < Gem::TestCase
def test_verbose_download_reporter_progress_complete
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
reporter.update 510
reporter.done
assert_equal "Fetching a.gem\n", @out.string
@@ -198,7 +198,7 @@ class TestGemStreamUI < Gem::TestCase
def test_verbose_download_reporter_progress_nil_length
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', nil
+ reporter.fetch "a.gem", nil
reporter.update 1024
reporter.done
assert_equal "Fetching a.gem\n", @out.string
@@ -207,7 +207,7 @@ class TestGemStreamUI < Gem::TestCase
def test_verbose_download_reporter_progress_zero_length
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 0
+ reporter.fetch "a.gem", 0
reporter.update 1024
reporter.done
assert_equal "Fetching a.gem\n", @out.string
@@ -218,7 +218,7 @@ class TestGemStreamUI < Gem::TestCase
@cfg.verbose = true
reporter = @sui.download_reporter
- reporter.fetch 'a.gem', 1024
+ reporter.fetch "a.gem", 1024
assert_equal "", @out.string
end
end