@@ -248,3 +248,39 @@ test_that ("cm data gh repo", {
248
248
expect_type (repo [[n ]], type )
249
249
}
250
250
})
251
+
252
+ test_that (" cm data gh forks" , {
253
+
254
+ Sys.setenv (" REPOMETRICS_TESTS" = " true" )
255
+ mock_cm_data ()
256
+ path <- generate_test_pkg ()
257
+ forks <- cm_data_repo_forks (path )
258
+ fs :: dir_delete (path )
259
+
260
+ expect_s3_class (forks , " data.frame" )
261
+ expect_equal (nrow (forks ), 2L )
262
+ expect_equal (ncol (forks ), 2L )
263
+ nms <- c (" org_repo" , " created" )
264
+ expect_equal (names (forks ), nms )
265
+
266
+ expect_type (forks $ org_repo , " character" )
267
+ expect_type (forks $ created , " double" )
268
+ })
269
+
270
+ test_that (" cm data gh stars" , {
271
+
272
+ Sys.setenv (" REPOMETRICS_TESTS" = " true" )
273
+ mock_cm_data ()
274
+ path <- generate_test_pkg ()
275
+ stars <- cm_data_repo_stargazers (path )
276
+ fs :: dir_delete (path )
277
+
278
+ expect_s3_class (stars , " data.frame" )
279
+ expect_equal (nrow (stars ), 2L )
280
+ expect_equal (ncol (stars ), 2L )
281
+ nms <- c (" login" , " starred_at" )
282
+ expect_equal (names (stars ), nms )
283
+
284
+ expect_type (stars $ login , " character" )
285
+ expect_type (stars $ starred_at , " double" )
286
+ })
0 commit comments