@@ -6,7 +6,7 @@ describe("Note", function() {
66 var NodeGit = require ( "../../" ) ;
77 var Note = NodeGit . Note ;
88 var Signature = NodeGit . Signature ;
9- var reposPath = local ( "../repos/merge " ) ;
9+ var reposPath = local ( "../../ " ) ;
1010
1111 beforeEach ( function ( ) {
1212 var test = this ;
@@ -37,16 +37,33 @@ describe("Note", function() {
3737 } ) ;
3838 } ) ;
3939
40+ it ( "can iterate all notes" , function ( ) {
41+ var test = this ;
42+ var noteRef = "refs/notes/commits" ;
43+ var ref = null ;
44+
45+ return Note . foreach ( this . repository , noteRef , function ( blobId , objectId ) {
46+ ref = objectId ;
47+ } ) . then ( function ( ) {
48+ return NodeGit . Note . read ( test . repository , noteRef , ref )
49+ . then ( function ( note ) {
50+ assert . equal ( note . message ( ) , "Testing!" ) ;
51+ } ) ;
52+ } ) ;
53+ } ) ;
54+
4055 it ( "can be removed" , function ( done ) {
56+ var test = this ;
4157 var sha = this . commit . id ( ) ;
4258 var noteRef = "refs/notes/commits" ;
4359 var sig = Signature . create ( "John" , "john@doe.com" , Date . now ( ) , 0 ) ;
4460
45- Note . remove ( this . repository , noteRef , sig , sig , sha ) ;
46-
47- return Note . read ( this . repository , noteRef , sha ) . catch ( function ( ex ) {
48- assert . equal ( ex . message , "Note could not be found" ) ;
49- done ( ) ;
50- } ) ;
61+ return Note . remove ( this . repository , noteRef , sig , sig , sha )
62+ . then ( function ( ) {
63+ return Note . read ( test . repository , noteRef , sha ) . catch ( function ( ex ) {
64+ assert . equal ( ex . message , "Note could not be found" ) ;
65+ done ( ) ;
66+ } ) ;
67+ } ) ;
5168 } ) ;
5269} ) ;
0 commit comments