1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +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"} , "dependencies": {"underscore": "1.x.x"}
, "devDependencies": , "devDependencies":
{ "should": "0.4.x" { "should": "1.2.x"
, "mocha": "0.x.x" , "mocha": "0.x.x"
, "coffee-script": "1.1.x" , "coffee-script": "1.1.x"
} }

View File

@ -21,4 +21,6 @@ S.Status = class Status
continue continue
file = line.substr 3 file = line.substr 3
type = line.substr 0,2 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' Status = require '../src/status'
GIT_STATUS = """ GIT_STATUS = """
# On branch master M cheese.txt
# Changes to be committed: D crackers.txt
# (use "git reset HEAD <file>..." to unstage) M file.txt
# ?? pickles.txt
# 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)
""" """
GIT_STATUS_CLEAN = ""
GIT_STATUS_NOT_CLEAN = """ GIT_STATUS_NOT_CLEAN = """
# On branch master A lib/index.js
# Changes not staged for commit: M npm-shrinkwrap.json
# (use "git add ..." to update what will be committed) M package.json
# (use "git checkout -- ..." to discard changes in working directory)
#
# modified: lib/index.js
# modified: npm-shrinkwrap.json
# modified: package.json
#
""" """
describe "Status", -> describe "Status", ->