-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create placeholder spec for fixed index out of bounds error
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "./spec_helper" | ||
require "../src/entry" | ||
require "../src/options" | ||
|
||
def new_formatter(path, options = Lister::Options.new) | ||
Lister::Formatter.new(path, options) | ||
end | ||
|
||
describe Lister::Formatter do | ||
klass = Lister::Formatter | ||
|
||
describe "#line" do | ||
pending "should not attempt to insert color codes past the end of the line" do | ||
long_filename = "asdfghjklqwertyuiopzxcvbnm" | ||
opts = Lister::Options.new | ||
# stub out terminal width somehow | ||
opts.terminal.width | ||
# make entry | ||
entry = Entry.new long_filename, opts | ||
formatter = new_formatter(long_filename, opts) | ||
formatter.line(entry, entry.name.size, 0) | ||
# should generate a filename much lonager than the line, which before the fix would error out | ||
# like "index out of range" for String#insert | ||
end | ||
end | ||
end |