Sha256: 00a85f48e70839d6ea73508dd5c560270d33cfa051fd8843329db2e70c70e2b9
Contents?: true
Size: 1.75 KB
Versions: 10
Compression:
Stored size: 1.75 KB
Contents
Feature: Pretty-print with source location Kernel#qql works just like Kernel#pp from the built-in pp library, except that it writes to $stderr _and_ it labels the output with the source location. If the filename is long, then the source location is printed on a line of its own. Scenario: One argument Given a file named "example.rb" with: """ require "cute_print" a = [ "Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter.", ] qql a """ Then stderr should be """ example.rb:10: ["Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter."] """ Scenario: Two arguments Given a file named "example.rb" with: """ require "cute_print" qql 1, "foo" """ Then stderr should be """ example.rb:2: 1 example.rb:2: "foo" """ Scenario: Very long label Given a file named "long____________________________filename.rb" with: """ require "cute_print" a = [ "Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter.", ] qql a """ Then stderr should be """ long____________________________filename.rb:10: ["Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter."] """
Version data entries
10 entries across 10 versions & 1 rubygems