Skip to content

Commit 36a9830

Browse files
djberubematzbot
authored andcommitted
[rubygems/rubygems] make pretty_print tests whitespace agnostic
ruby/rubygems@23e9396d22
1 parent 7e02410 commit 36a9830

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

test/rubygems/test_gem_source_git.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ def test_uri
293293
end
294294

295295
def test_pretty_print
296-
assert_equal "#<Gem::Source::Git[Git: \n" \
297-
" #{@repository}\n" \
298-
" HEAD]>\n", @source.pretty_inspect
296+
assert_equal "#<Gem::Source::Git[Git: #{@repository} HEAD]>", @source.pretty_inspect.gsub(/\s+/, " ").strip
299297
end
300298

301299
def test_uri_hash

test/rubygems/test_gem_source_installed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def test_spaceship
3535

3636
def test_pretty_print
3737
local = Gem::Source::Installed.new
38-
assert_equal "#<Gem::Source::Installed[Installed]>\n", local.pretty_inspect
38+
assert_equal "#<Gem::Source::Installed[Installed]>", local.pretty_inspect.gsub(/\s+/, " ").strip
3939
end
4040
end

test/rubygems/test_gem_source_local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ def test_spaceship
107107

108108
def test_pretty_print
109109
local = Gem::Source::Local.new
110-
assert_equal "#<Gem::Source::Local[Local gems: ]>\n", local.pretty_inspect
110+
assert_equal "#<Gem::Source::Local[Local gems: ]>", local.pretty_inspect.gsub(/\s+/, " ").strip
111111
end
112112
end

test/rubygems/test_gem_source_specific_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ def test_spaceship
7575
end
7676

7777
def test_pretty_print
78-
assert_equal "#<Gem::Source::SpecificFile[SpecificFile:\n #{@sf.path}]>\n", @sf.pretty_inspect
78+
assert_equal "#<Gem::Source::SpecificFile[SpecificFile: #{@sf.path}]>", @sf.pretty_inspect.gsub(/\s+/, " ").strip
7979
end
8080
end

0 commit comments

Comments
 (0)