Skip to content

Commit

Permalink
export the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineStawitz-NOAA committed Jun 21, 2022
1 parent 644088f commit 7ce6a05
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(build_email)
export(create_issue_table)
export(create_pr_table)
export(get_issues)
1 change: 1 addition & 0 deletions R/create_issue_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#'
#' @param json_input A \code{json} table generated from the Github API.
#' @return A \code{html} table of issues.
#' @export
create_issue_table <- function(json_input) {
sub <- json_input |> dplyr::select(
"number", "title", "labels",
Expand Down
1 change: 1 addition & 0 deletions R/create_pr_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#'
#' @param json_input A \code{json} table generated from the Github API.
#' @return A \code{html} table of pull requests.
#' @export
create_pr_table <- function(json_input) {
sub <- json_input |> dplyr::select(
"number", "title", "labels",
Expand Down
1 change: 1 addition & 0 deletions R/get_issues.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' @param secret_ The secret corresponding to the key.
#' @param repo_name The name of the repository
#' @return A \code{json} list of returned issues from Github.
#' @export
get_issues <- function(appname_, key_, secret_, repo_name) {

# Change based on what you
Expand Down
4 changes: 1 addition & 3 deletions man/get_issues.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 8 additions & 14 deletions tests/testthat/test-build_email.r
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
test_that("build_email works", {
#use httr package example
json_in <- get_issues(appname_ = "github",
key_ = "56b637a5baffac62cad9",
secret_ = "8e107541ae1791259e9987d544ca568633da2ebf",
repo_name = "r-lib/httr")
# test_that("build_email works", {
# #use httr package example
# testthat::expect_output(get_issues(appname_ = "github",
# key_ = "56b637a5baffac62cad9",
# secret_ = "8e107541ae1791259e9987d544ca568633da2ebf",
# repo_name = "r-lib/httr"))

testthat::expect_output(
build_email(from = "[email protected]",
to = "[email protected]", creds = creds(provider = "gmail",
user = "[email protected]"), body = "Hi, Check out the current status",
table_iss = create_pr_table(json_in),
table_pr = create_issue_table(json_in), footer_ = "Thanks, \n Christine")
)
})

# })

0 comments on commit 7ce6a05

Please sign in to comment.