     'YWJj':'abc'
 
 
-
 describe 'sco command-line test', ->
-  this.timeout 5000
-
   it 'display version if -v option specified', (done) ->
     exec sco + '-v', (error, stdout, stderr) ->
-      assert t(stdout) == pack['version']
+      assert stdout is pack['version']+eol
       done()
 
   it 'display help message if -h option specified', (done) ->
     exec sco + '-h', (error, stdout, stderr) ->
-      assert.ok t(stdout).match('help')
+      assert.ok stdout.match('help')
       done()
 
 describe 'cli encode test', ->

assert = require 'power-assert'
exec = require('child_process').exec
pack = require '../package.json'

sco = 'node bin/sco '

# trim last linebreak
t = (str) ->
  str[0...-1]

encode_testset =
  'ascii':

        do (key, value) ->
          it algo + ': ' + key + ' -> ' + value, (done) ->
            exec sco + "-d #{algo} \"#{key}\"", (error, stdout, stderr) ->
              assert stdout is value
              done()

describe 'cli encode and decode test using pipes', ->
  it 'echo hello | sco -e base64 | sco -d base64', (done) ->
    test_using_pipe = "echo hello | #{sco} -e base64 | #{sco} -d base64"
    exec test_using_pipe, (error, stdout, stderr) ->
      assert stdout is "hello"+eol
      done()
