Skip to content

Commit

Permalink
Merge pull request #12 from nfischer/test-assert-inspect-better
Browse files Browse the repository at this point in the history
  • Loading branch information
nfischer authored Jan 14, 2022
2 parents 40a1aa4 + e7f0447 commit 1d54300
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ describe('plugin-inspect', function () {

it('works for strings', function () {
var ret = shell.cat('index.js');
ret[inspectAttribute]().should.equal(fs.readFileSync('index.js', 'utf-8'));
util.inspect(ret).should.equal(fs.readFileSync('index.js', 'utf-8'));
});

it.skip('works for commands with no trailing newline', function () {
var ret = shell.pwd();
ret[inspectAttribute]().should.equal(process.cwd() + '\n');
util.inspect(ret).should.equal(process.cwd() + '\n');
});

it('works for arrays', function () {
var ret = shell.cat('index.js');
ret[inspectAttribute]().should.equal(fs.readFileSync('index.js', 'utf-8'));
util.inspect(ret).should.equal(fs.readFileSync('index.js', 'utf-8'));
});

it('gets applied directly to ShellStrings', function () {
var ret = new shell.ShellString('Hello world');
ret[inspectAttribute]().should.be.type('string');
ret[inspectAttribute]().should.equal('Hello world');
util.inspect(ret).should.be.type('string');
util.inspect(ret).should.equal('Hello world');
});

it('works for piped commands', function () {
var ret = shell.cat('index.js').grep('o');
ret[inspectAttribute]().should.equal(shell.grep('o', 'index.js').toString());
util.inspect(ret).should.equal(shell.grep('o', 'index.js').toString());
});

it('works for commands that have errors', function () {
var ret = shell.rm('fakeFileName.txt');
ret[inspectAttribute]().should.equal('');
util.inspect(ret).should.equal('');
});

it('does not break non-ShellString commands', function () {
Expand Down

0 comments on commit 1d54300

Please sign in to comment.