Skip to content

Commit

Permalink
fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
nagy committed Mar 13, 2013
1 parent c905ba0 commit bc3f389
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
4 changes: 3 additions & 1 deletion src/status.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
38 changes: 8 additions & 30 deletions test/status.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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", ->
Expand Down

0 comments on commit bc3f389

Please sign in to comment.