1
0
mirror of https://github.com/danog/gift.git synced 2024-11-26 20:04:47 +01:00

fix unittests

This commit is contained in:
Daniel Nagy 2013-03-13 21:24:57 +00:00
parent c905ba05e2
commit bc3f389ee6
3 changed files with 12 additions and 32 deletions

View File

@ -23,7 +23,7 @@
, "dependencies": {"underscore": "1.x.x"}
, "devDependencies":
{ "should": "0.4.x"
{ "should": "1.2.x"
, "mocha": "0.x.x"
, "coffee-script": "1.1.x"
}

View File

@ -21,4 +21,6 @@ S.Status = class Status
continue
file = line.substr 3
type = line.substr 0,2
@files[file] = { type: type.trim(), staged: (line[0] != " " and line[0] != "?" ) , tracked: line[0] != "?" }
@files[file] = { staged: (line[0] != " " and line[0] != "?" ) , tracked: line[0] != "?" }
if type != "??"
@files[file].type = type.trim()

View File

@ -4,38 +4,16 @@ git = require '../src'
Status = require '../src/status'
GIT_STATUS = """
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: crackers.txt
# modified: file.txt
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: cheese.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# pickles.txt
"""
GIT_STATUS_CLEAN = """
# On branch master
# nothing to commit (working directory clean)
M cheese.txt
D crackers.txt
M file.txt
?? pickles.txt
"""
GIT_STATUS_CLEAN = ""
GIT_STATUS_NOT_CLEAN = """
# On branch master
# Changes not staged for commit:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: lib/index.js
# modified: npm-shrinkwrap.json
# modified: package.json
#
A lib/index.js
M npm-shrinkwrap.json
M package.json
"""
describe "Status", ->