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 e89ddf1 + 0b26205 commit e650960Copy full SHA for e650960
lib/power_assert/inspector.rb
@@ -1,5 +1,8 @@
1
require 'power_assert/configuration'
2
-require 'io/console/size'
+begin
3
+ require 'io/console/size'
4
+rescue LoadError
5
+end
6
7
module PowerAssert
8
class InspectedValue
@@ -44,7 +47,8 @@ def initialize(value, indent)
44
47
def inspect
45
48
if PowerAssert.configuration.colorize_message
46
49
if PowerAssert.configuration.inspector == :pp
- width = [IO.console_size[1] - 1 - @indent, 10].max
50
+ console_width = IO.respond_to?(:console_size) ? IO.console_size[1] : 80
51
+ width = [console_width - 1 - @indent, 10].max
52
IRB::ColorPrinter.pp(@value, '', width)
53
else
54
IRB::Color.colorize_code(@value.to_s, ignore_error: true)
0 commit comments