@@ -10,6 +10,7 @@ describe('Gist', function() {
10
10
let gistId ;
11
11
let github ;
12
12
let commentId ;
13
+ let revisionId ;
13
14
14
15
before ( function ( ) {
15
16
github = new Github ( {
@@ -51,6 +52,7 @@ describe('Gist', function() {
51
52
expect ( gist ) . to . have . own ( 'public' , testGist . public ) ;
52
53
expect ( gist ) . to . have . own ( 'description' , testGist . description ) ;
53
54
gistId = gist . id ;
55
+ revisionId = gist . history [ 0 ] . version ;
54
56
55
57
done ( ) ;
56
58
} ) ) ;
@@ -99,6 +101,36 @@ describe('Gist', function() {
99
101
it ( 'should delete comment' , function ( done ) {
100
102
gist . deleteComment ( commentId , assertSuccessful ( done ) ) ;
101
103
} ) ;
104
+
105
+ it ( 'should update gist' , function ( done ) {
106
+ const newGist = {
107
+ files : {
108
+ 'README.md' : {
109
+ content : 'README updated' ,
110
+ } ,
111
+ } ,
112
+ } ;
113
+ gist . update ( newGist , assertSuccessful ( done , function ( err , gist ) {
114
+ expect ( gist . history . length ) . to . be ( 2 ) ;
115
+ expect ( gist . files [ 'README.md' ] ) . to . have . own ( 'content' , newGist . files [ 'README.md' ] . content ) ;
116
+ done ( ) ;
117
+ } ) ) ;
118
+ } ) ;
119
+
120
+ it ( 'should list commits' , function ( done ) {
121
+ gist . listCommits ( assertSuccessful ( done , function ( err , commits ) {
122
+ expect ( commits ) . to . be . an . array ( ) ;
123
+ done ( ) ;
124
+ } ) ) ;
125
+ } ) ;
126
+
127
+ it ( 'should get revision' , function ( done ) {
128
+ gist . getRevision ( revisionId , assertSuccessful ( done , function ( err , gist ) {
129
+ expect ( gist . history . length ) . to . be ( 1 ) ;
130
+ expect ( gist . files [ 'README.md' ] ) . to . have . own ( 'content' , testGist . files [ 'README.md' ] . content ) ;
131
+ done ( ) ;
132
+ } ) ) ;
133
+ } ) ;
102
134
} ) ;
103
135
104
136
describe ( 'deleting' , function ( ) {
0 commit comments