Skip to content

Commit

Permalink
Add unknown modules tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSKunk committed Mar 1, 2013
1 parent 0f3852b commit 8c54f3b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion test/fixtures/modules/unknown.coffee
@@ -1 +1,14 @@
module.exports = {}
module.exports = [
{
isVendor: no
location: 'controller.awesome'
path: 'controllers/awesome'
varName: 'AwesomeController'
}
{
isVendor: no
location: 'module.awesome'
path: 'modules/awesome'
varName: 'AwesomeModule'
}
]
15 changes: 14 additions & 1 deletion test/spec/module_spec.coffee
Expand Up @@ -4,7 +4,7 @@ expect = require('chai').expect
extend = require 'node.extend'

ExistingModulesFixtures = require './fixtures/modules/existing'
UnknownModulesFixtures = require './fixtures/modules/existing'
UnknownModulesFixtures = require './fixtures/modules/unknown'

describe 'module', ->

Expand All @@ -31,3 +31,16 @@ describe 'module', ->

it 'should generate the correct var name', ->
expect(module.getVarName()).to.equal moduleFixture.varName

for moduleFixture in UnknownModulesFixtures
do (moduleFixture) ->
module = new Module
isVendor: moduleFixture.isVendor
location: moduleFixture.location
, settings, settings.paths.app

it 'should be instantied', ->
expect(module).to.be.an.instanceof Module

it 'should not find the file path of ' + moduleFixture.location, ->
expect(module.findPath()).to.be.false

0 comments on commit 8c54f3b

Please sign in to comment.