We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e086e6 commit 1df210dCopy full SHA for 1df210d
lib/pp.rb
@@ -442,7 +442,7 @@ def pretty_print_cycle(q) # :nodoc:
442
443
class Range # :nodoc:
444
def pretty_print(q) # :nodoc:
445
- q.pp self.begin
+ q.pp self.begin if self.begin
446
q.breakable ''
447
q.text(self.exclude_end? ? '...' : '..')
448
test/test_pp.rb
@@ -28,6 +28,13 @@ def o.method
28
end
29
assert_equal(%(""\n), PP.pp(o, "".dup))
30
31
+
32
+ def test_range
33
+ assert_equal("0..1\n", PP.pp(0..1, "".dup))
34
+ assert_equal("0...1\n", PP.pp(0...1, "".dup))
35
+ assert_equal("0...\n", PP.pp(0..., "".dup))
36
+ assert_equal("...1\n", PP.pp(...1, "".dup))
37
+ end
38
39
40
class HasInspect
0 commit comments