Permalink
Browse files

Test travis

  • Loading branch information...
wdavidw committed Feb 18, 2012
1 parent 6e115ab commit 826026dbbca88a968b5f226d808042bb2c0e4175
Showing with 18 additions and 8 deletions.
  1. +1 −1 .travis.yml
  2. +6 −1 lib/mecano.coffee
  3. +11 −6 test/exec.coffee
View
@@ -5,4 +5,4 @@ node_js:
- 0.6
- 0.7
before_script:
- - "sudo apt-get install git"
+ - "sudo ssh-copy-id ${whoami}@localhost"
View
@@ -334,7 +334,12 @@ mecano = module.exports =
#cmd: "git init && git remote add origin #{options.source} && git branch --track master origin/master && git pull"
cmd: "git clone #{options.source} #{path.basename options.destination}"
cwd: path.dirname options.destination
- , (err) ->
+ , (err, executed, stdout, stderr) ->
+ console.log '================='
+ console.log stdout
+ console.log '-----------------'
+ console.log stderr
+ console.log '================='
return next err if err
checkout()
log = ->
View
@@ -21,25 +21,30 @@ describe 'exec', ->
next()
it 'should stream stdout', (next) ->
+ @timeout 10000000
+ end_called = null
evemit = new EventEmitter
- evemit.on 'data', (data) -> stdout.should.eql 'yes\n'
- evemit.end = next
+ evemit.writable = true
+ evemit.write = (data) ->
+ data.should.include 'myself'
+ evemit.end = -> end_called = true
mecano.exec
- host: 'localhost'
- cmd: 'text=yes; echo $text'
+ cmd: "cat #{__filename}"
stdout: evemit
, (err, executed, stdout, stderr) ->
should.not.exist stdout
+ end_called.should.be.ok
+ next()
it 'should validate exit code', (next) ->
# code undefined
mecano.exec
- cmd: "ls -l #{__dirname}/toto"
+ cmd: "chown"
, (err, executed, stdout, stderr) ->
err.message.should.eql 'Invalid exec code 1'
# code defined in array
mecano.exec
- cmd: "ls -l #{__dirname}/toto"
+ cmd: "chown"
code: [0, 1]
, (err, executed, stdout, stderr) ->
should.not.exist err

0 comments on commit 826026d

Please sign in to comment.