[Pkg-javascript-commits] [node-cliui] 01/03: restore file from upstream
Paolo Greppi
paolog-guest at moszumanska.debian.org
Tue Nov 29 12:14:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
paolog-guest pushed a commit to branch master
in repository node-cliui.
commit a2f4b5c787f152694b0ed031d5b40ed1b234962e
Author: Paolo Greppi <paolo.greppi at libpf.com>
Date: Tue Nov 29 11:57:27 2016 +0000
restore file from upstream
---
test/cliui.js | 80 +++++++++++++++++++++++++++++------------------------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/test/cliui.js b/test/cliui.js
index 9ce1081..fd27f5a 100644
--- a/test/cliui.js
+++ b/test/cliui.js
@@ -1,6 +1,6 @@
/* global describe, it */
-var assert = require('assert')
+require('chai').should()
var chalk = require('chalk')
var cliui = require('../')
@@ -16,7 +16,7 @@ describe('cliui', function () {
ui.div('i am a string that should be wrapped')
ui.toString().split('\n').forEach(function (row) {
- assert(row.length <= 10)
+ row.length.should.be.lte(10)
})
})
@@ -34,7 +34,7 @@ describe('cliui', function () {
// total width of all columns is <=
// the width cliui is initialized with.
ui.toString().split('\n').forEach(function (row) {
- assert(row.length <= 40)
+ row.length.should.be.lte(40)
})
// it should wrap each column appropriately.
@@ -46,7 +46,7 @@ describe('cliui', function () {
' wrapped'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('allows for a blank row to be appended', function () {
@@ -59,7 +59,7 @@ describe('cliui', function () {
// it should wrap each column appropriately.
var expected = ['']
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
})
@@ -70,9 +70,9 @@ describe('cliui', function () {
})
var widths = ui._columnWidths([{}, {}, {}])
- assert(widths[0] == 13)
- assert(widths[1] == 13)
- assert(widths[2] == 13)
+ widths[0].should.equal(13)
+ widths[1].should.equal(13)
+ widths[2].should.equal(13)
})
it('divides width over remaining columns if first column has width specified', function () {
@@ -81,9 +81,9 @@ describe('cliui', function () {
})
var widths = ui._columnWidths([{width: 20}, {}, {}])
- assert(widths[0] == 20)
- assert(widths[1] == 10)
- assert(widths[2] == 10)
+ widths[0].should.equal(20)
+ widths[1].should.equal(10)
+ widths[2].should.equal(10)
})
it('divides width over remaining columns if middle column has width specified', function () {
@@ -92,9 +92,9 @@ describe('cliui', function () {
})
var widths = ui._columnWidths([{}, {width: 10}, {}])
- assert(widths[0] == 15)
- assert(widths[1] == 10)
- assert(widths[2] == 15)
+ widths[0].should.equal(15)
+ widths[1].should.equal(10)
+ widths[2].should.equal(15)
})
it('keeps track of remaining width if multiple columns have width specified', function () {
@@ -103,9 +103,9 @@ describe('cliui', function () {
})
var widths = ui._columnWidths([{width: 20}, {width: 12}, {}])
- assert(widths[0] == 20)
- assert(widths[1] == 12)
- assert(widths[2] == 8)
+ widths[0].should.equal(20)
+ widths[1].should.equal(12)
+ widths[2].should.equal(8)
})
it('uses a sane default if impossible widths are specified', function () {
@@ -114,9 +114,9 @@ describe('cliui', function () {
})
var widths = ui._columnWidths([{width: 30}, {width: 30}, {padding: [0, 2, 0, 1]}])
- assert(widths[0] == 30)
- assert(widths[1] == 30)
- assert(widths[2] == 4)
+ widths[0].should.equal(30)
+ widths[1].should.equal(30)
+ widths[2].should.equal(4)
})
})
@@ -140,7 +140,7 @@ describe('cliui', function () {
' wrapped'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('allows a column to be center aligned', function () {
@@ -161,7 +161,7 @@ describe('cliui', function () {
' wrapped'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
})
@@ -185,7 +185,7 @@ describe('cliui', function () {
' left'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('handles top/bottom padding', function () {
@@ -209,7 +209,7 @@ describe('cliui', function () {
''
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('preserves leading whitespace as padding', function () {
@@ -223,9 +223,9 @@ describe('cliui', function () {
' with ansi'
]
- assert(ui.toString().split('\n').map(function (l) {
+ ui.toString().split('\n').map(function (l) {
return stripAnsi(l)
- }) == expected)
+ }).should.eql(expected)
})
})
@@ -248,7 +248,7 @@ describe('cliui', function () {
" '------------------'"
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
})
@@ -264,7 +264,7 @@ describe('cliui', function () {
{text: 'i am a third string that should not be wrapped', padding: [0, 0, 0, 2]}
)
- assert(ui.toString() == 'i am a string i am a second string i am a third string that should not be wrapped')
+ ui.toString().should.equal('i am a string i am a second string i am a third string that should not be wrapped')
})
})
@@ -287,7 +287,7 @@ describe('cliui', function () {
'wrapped [required] [default: 99]'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('does not append the string if it does not fit on the prior row', function () {
@@ -309,7 +309,7 @@ describe('cliui', function () {
'i am a second row'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('always appends text to prior span if wrap is disabled', function () {
@@ -333,7 +333,7 @@ describe('cliui', function () {
'a third line'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('appends to prior line appropriately when strings contain ansi escape codes', function () {
@@ -354,9 +354,9 @@ describe('cliui', function () {
'wrapped [required] [default: 99]'
]
- assert(ui.toString().split('\n').map(function (l) {
+ ui.toString().split('\n').map(function (l) {
return stripAnsi(l)
- }) == expected)
+ }).should.eql(expected)
})
})
@@ -375,7 +375,7 @@ describe('cliui', function () {
' <my second thing> another row a third column'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('turns newline into multiple rows', function () {
@@ -393,7 +393,7 @@ describe('cliui', function () {
' glob'
]
- assert(ui.toString().split('\n') == expected)
+ ui.toString().split('\n').should.eql(expected)
})
it('aligns rows appropriately when they contain ansi escape codes', function () {
@@ -412,9 +412,9 @@ describe('cliui', function () {
' glob'
]
- assert(ui.toString().split('\n').map(function (l) {
+ ui.toString().split('\n').map(function (l) {
return stripAnsi(l)
- }) == expected)
+ }).should.eql(expected)
})
it('ignores ansi escape codes when measuring padding', function () {
@@ -436,9 +436,9 @@ describe('cliui', function () {
' '
]
- assert(ui.toString().split('\n').map(function (l) {
+ ui.toString().split('\n').map(function (l) {
return stripAnsi(l)
- }) == expected)
+ }).should.eql(expected)
})
it('does not apply DSL if wrap is false', function () {
@@ -451,7 +451,7 @@ describe('cliui', function () {
'Usage: $0\ttwo\tthree'
)
- assert(ui.toString() == 'Usage: $0\ttwo\tthree')
+ ui.toString().should.eql('Usage: $0\ttwo\tthree')
})
})
})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-cliui.git
More information about the Pkg-javascript-commits
mailing list