Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test travis

  • Loading branch information...
commit 826026dbbca88a968b5f226d808042bb2c0e4175 1 parent 6e115ab
@wdavidw wdavidw authored
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
2  .travis.yml
@@ -5,4 +5,4 @@ node_js:
- 0.6
- 0.7
before_script:
- - "sudo apt-get install git"
+ - "sudo ssh-copy-id ${whoami}@localhost"
View
7 lib/mecano.coffee
@@ -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
17 test/exec.coffee
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.