Skip to content

Commit eda4b2d

Browse files
committed
fix filename test and prefix utils to browseURL
1 parent 4e7e4cc commit eda4b2d

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ importFrom(plyr,ddply)
4444
importFrom(plyr,join)
4545
importFrom(plyr,summarise)
4646
importFrom(stats,setNames)
47+
importFrom(utils,browseURL)
4748
importFrom(utils,data)
4849
importFrom(utils,getFromNamespace)
4950
importFrom(utils,modifyList)

R/print.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ toWidget <- function(x) {
5353
#' @param ... additional arguments (currently ignored)
5454
#' @export
5555
print.figure <- function(x, ...) {
56-
browseURL(x$url)
56+
utils::browseURL(x$url)
5757
}
5858

5959
#' Embed a plotly figure as an iframe in a knitr doc

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#' @importFrom grDevices col2rgb
2-
#' @importFrom utils getFromNamespace modifyList data packageVersion
2+
#' @importFrom utils getFromNamespace modifyList data packageVersion browseURL
33
#' @importFrom stats setNames
44

55
is.plotly <- function(x) inherits(x, "plotly")

tests/testthat/test-plotly-filename.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ context("Filename")
22

33
test_that("filepath with directories is returned as passed", {
44
skip_on_cran()
5-
p <- plot_ly(mtcars, x = wt, y = vs, filename = "directory/awesome")
6-
expect_match(plotly_POST(p)$filename, "directory/awesome")
5+
p <- plot_ly(mtcars, x = wt, y = vs)
6+
f <- plotly_POST(p, filename = "directory/awesome")
7+
expect_match(f$filename, "directory/awesome")
78
})

0 commit comments

Comments
 (0)