1. All tests have been converted into regular command-line mocha tests (instead of running in the browser), and the deployment script has been changed to automatically fail any `--new` deployment which doesn't pass. 2. Several small class (e.g., `Logger`) have been moved into a common module, `crafting-guide-common` so that they may be shared between the client and server.
31 lines
945 B
CoffeeScript
31 lines
945 B
CoffeeScript
###
|
|
Crafting Guide - mod.test.coffee
|
|
|
|
Copyright (c) 2015 by Redwood Labs
|
|
All rights reserved.
|
|
###
|
|
|
|
Mod = require '../src/coffee/models/mod'
|
|
|
|
########################################################################################################################
|
|
|
|
mod = null
|
|
|
|
########################################################################################################################
|
|
|
|
describe 'mod.coffee', ->
|
|
|
|
beforeEach -> mod = new Mod name:'Test', slug:'test'
|
|
|
|
describe 'compareTo', ->
|
|
|
|
it 'lists required mods first', ->
|
|
minecraft = new Mod name:'Minecraft', slug:'minecraft'
|
|
mod.compareTo(minecraft).should.equal +1
|
|
minecraft.compareTo(mod).should.equal -1
|
|
|
|
it 'sorts by name second', ->
|
|
buildcraft = new Mod name:'Buildcraft', slug:'buildcraft'
|
|
mod.compareTo(buildcraft).should.equal +1
|
|
buildcraft.compareTo(mod).should.equal -1
|