Skip to content

Commit

Permalink
Add test Constellation#11
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Jun 6, 2015
1 parent 1452ee2 commit ccbea85
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/fixture/issue11.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Dependencies
expect= require('chai').expect

# Fixture
fixtureFixture= require './test004'

# Specs
describe 'cover to code',->
it '(#issue11 fixture)',->
expect(fixtureFixture('Hello')).to.equal "Hello Path"
35 changes: 35 additions & 0 deletions test/issue11.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dependencies
expect= require('chai').expect

exec= (require 'child_process').exec
Promise= require 'bluebird'

# Fixture
$ibrik= (command)->
bin= require.resolve '../bin/ibrik'
script= bin+command

new Promise (resolve,reject)->
exec script,(error,stdout,stderr)->
return reject error if error?

resolve stdout

# Specs
describe 'issue#11',->
it 'Include test/**',(done)->
command= ''
command+= ' cover '+(require.resolve 'mocha/bin/_mocha')

command+= ' --default-excludes ""'

command+= ' -- '
command+= ' test/fixture/issue11.coffee '
command+= ' --reporter spec'
command+= ' --recursive test'
command+= ' --compilers coffee:coffee-script/register'

$ibrik command
.then (stdout)->
expect(stdout).to.match /Coverage summary/
done()

0 comments on commit ccbea85

Please sign in to comment.