--- a/spec/hglib_spec.lua Fri Sep 16 15:50:07 2016 +0800
+++ b/spec/hglib_spec.lua Fri Sep 16 15:50:45 2016 +0800
local client = hglib.Client.open()
local code, o, e, d = client:runcommand({'version', '--verbose'})
- assert.are_equal(0, code)
assert.is_not_nil(o:find('Mercurial Distributed SCM'))
assert.is_not_nil(o:find('Enabled extensions:'))
+ assert.are_equal(0, code)
it('can use runcommand to run nonexistent command', function()
local client = hglib.Client.open()
local code, o, e, d = client:runcommand({'extirpate'})
- assert.are_equal(255, code)
assert.is_not_nil(o:find('use "hg help" for the full list of commands'))
assert.is_not_nil(e:find('unknown command'))
+ assert.are_equal(255, code)
it('can use runcommand to inspect this repo', function()
local client = hglib.Client.open('.')
local code, o, e, d = client:runcommand({'log', '-r0'})
- assert.are_equal(0, code)
assert.is_not_nil(o:find('hglib: absolute basics'))
+ assert.are_equal(0, code)