[Blotter-commits] r1387 - pkg/FinancialInstrument/inst/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Feb 2 22:54:11 CET 2013
Author: gsee
Date: 2013-02-02 22:54:11 +0100 (Sat, 02 Feb 2013)
New Revision: 1387
Modified:
pkg/FinancialInstrument/inst/tests/test-getSymbols.FI.R
Log:
- add src=FI to getSymbols call in getSymbols.FI test.
- put data in a its own environment in test
- bump version
Modified: pkg/FinancialInstrument/inst/tests/test-getSymbols.FI.R
===================================================================
--- pkg/FinancialInstrument/inst/tests/test-getSymbols.FI.R 2013-02-02 21:44:39 UTC (rev 1386)
+++ pkg/FinancialInstrument/inst/tests/test-getSymbols.FI.R 2013-02-02 21:54:11 UTC (rev 1387)
@@ -2,13 +2,14 @@
from <- as.Date('2012-01-01')
to <- from + 9
-BID <- xts(1:10, as.Date(from:to))
+tmpenv <- new.env()
+tmpenv$BID <- xts(1:10, as.Date(from:to))
tmpdir <- file.path(tempdir(), "BID")
-saveSymbols.days("BID", tmpdir, extension="RData")
-rm(BID)
+dir.create(tmpdir, showWarnings=FALSE)
+saveSymbols.days("BID", tmpdir, extension="RData", env=tmpenv)
# make sure getSymbols.FI works if the directory has the same name as the Symbol
test_that("getSymbols.FI base_dir=Symbol", {
- expect_identical(NROW(getSymbols("BID", dir=tmpdir,
+ expect_identical(NROW(getSymbols("BID", src="FI", dir=tmpdir,
extension="RData", auto.assign=FALSE,
from=from, to=to, days_to_omit=NULL,
verbose=FALSE)), 10L)
More information about the Blotter-commits
mailing list