Skip to content

Commit

Permalink
Merge pull request #78 from wilsonfreitas/work
Browse files Browse the repository at this point in the history
Renamed functions, replaced dots with _
  • Loading branch information
wilsonfreitas authored Jun 24, 2018
2 parents ecaf737 + 4f83cff commit 52071fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export(calendars)
export(create.calendar)
export(following)
export(getdate)
export(has.calendars)
export(has_calendars)
export(holidays)
export(is.bizday)
export(load_calendar)
Expand All @@ -57,7 +57,7 @@ export(modified.following)
export(modified.preceding)
export(offset)
export(preceding)
export(remove.calendars)
export(remove_calendars)
export(save_calendar)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,toJSON)
Expand Down
10 changes: 5 additions & 5 deletions R/calendar.R
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ print.CalendarRegister <- function(x, ...) {
#' But the register object has its own \code{print} generic which helps listing
#' all registered calendars.
#'
#' \code{remove.calendars} remove calendars from the register.
#' \code{remove_calendars} remove calendars from the register.
#'
#' @name calendar-register
NULL
Expand All @@ -349,7 +349,7 @@ NULL
#' # ACTUAL calendar
#' cal <- create.calendar("Actual")
#' cal <- calendars()[["Actual"]]
#' remove.calendars("Actual")
#' remove_calendars("Actual")
#' # lists registered calendars
#' calendars()
calendars <- function() {
Expand All @@ -358,7 +358,7 @@ calendars <- function() {

#' @export
#' @rdname calendar-register
remove.calendars <- function(cals) {
remove_calendars <- function(cals) {
remove(list = cals, envir = .CALENDAR_REGISTER)
}

Expand All @@ -378,7 +378,7 @@ check_calendar <- function(cal) {
#' @export
#' @rdname calendar-register
#' @examples
#' has.calendars(c("actual", "weekends"))
has.calendars <- function(cals) {
#' has_calendars(c("actual", "weekends"))
has_calendars <- function(cals) {
cals %in% ls(.CALENDAR_REGISTER)
}
14 changes: 7 additions & 7 deletions man/calendar-register.Rd

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

8 changes: 4 additions & 4 deletions tests/testthat/test-register.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ test_that("it should set default calendar with calendar's name", {
test_that('it should remove a calendar', {
cal <- create.calendar("actual")
expect_false( is.null(calendars()[["actual"]]) )
remove.calendars("actual")
remove_calendars("actual")
expect_true( is.null(calendars()[["actual"]]) )
})

test_that("it should check if a calendar exists", {
create.calendar("actual")
expect_true(has.calendars("actual"))
expect_false(has.calendars("nama"))
expect_equal(has.calendars(c("actual", "weekends", "nama")),
expect_true(has_calendars("actual"))
expect_false(has_calendars("nama"))
expect_equal(has_calendars(c("actual", "weekends", "nama")),
c(TRUE, TRUE, FALSE))
})

0 comments on commit 52071fe

Please sign in to comment.