Logo: Relish

  1. Sign in

Project: Cute-print 0.2.0

Inspect with source location

Kernel#ql works just like Kernel#pp from the built-in pp library,
except that it writes to $stderr, and it prints the source
location.

Scenarios
Inspect an object
Given
a file named "example.rb" with:
require "cute_print"
ql "abc"
Then
stderr should be
example.rb:2: "abc"
Inspect two objects
Given
a file named "example.rb" with:
require "cute_print"
ql "abc", 123
Then
stderr should be
example.rb:2: "abc"
example.rb:2: 123
Inspect with location
Given
a file named "example.rb" with:
require "cute_print"
ql {1 + 2}
Then
stderr should be
example.rb:2: (1 + 2) is 3
Just print the location
Given
a file named "example.rb" with:
require "cute_print"
ql
Then
stderr should be
example.rb:2

Last published over 7 years ago by Wayne Conrad.