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.
2 parents 92ec862 + 1df210d commit f96c02cCopy full SHA for f96c02c
lib/pp.rb
@@ -444,7 +444,7 @@ def pretty_print_cycle(q) # :nodoc:
444
445
class Range # :nodoc:
446
def pretty_print(q) # :nodoc:
447
- q.pp self.begin
+ q.pp self.begin if self.begin
448
q.breakable ''
449
q.text(self.exclude_end? ? '...' : '..')
450
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