Skip to content

Commit

Permalink
Added travis-ci support
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathon-love committed Jan 17, 2017
1 parent fd4a550 commit 3cfa7bf
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@

language: r
cache: packages
warnings_are_errors: false
before_install:
- cd pkg/BayesFactor
1 change: 1 addition & 0 deletions README.md
@@ -1,4 +1,5 @@
[![DOI](https://zenodo.org/badge/6098/richarddmorey/BayesFactor.svg)](https://zenodo.org/badge/latestdoi/6098/richarddmorey/BayesFactor)
[![Build Status](https://travis-ci.org/richarddmorey/BayesFactor.svg)](https://travis-ci.org/richarddmorey/BayesFactor)

`BayesFactor` is an R package that enables the computation of Bayes factors in standard designs, such as one- and two- sample designs, ANOVA designs, regression, and analysis of contingency tables and proportions.

Expand Down
7 changes: 4 additions & 3 deletions pkg/BayesFactor/inst/tests/test-anovaBF.R
@@ -1,11 +1,12 @@

context("anovaBF")

test_that("Puzzles example works", {
data(puzzles)

bf = anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom = "ID",
iterations=1000, progress = FALSE)

expect_that(bf, is_a("BFBayesFactor"))
expect_that(length(bf), is_equivalent_to(4))
})
})
8 changes: 8 additions & 0 deletions pkg/BayesFactor/inst/tests/test-generalTestBF.R
@@ -0,0 +1,8 @@

context('generalTestBF')

data(puzzles)

test_that('generalTestBF works', {
generalTestBF(RT ~ shape*color*ID, whichRandom="ID", data = puzzles)
})
27 changes: 27 additions & 0 deletions pkg/BayesFactor/inst/tests/test-ttest.R
@@ -0,0 +1,27 @@

context('t-test')

data('ToothGrowth')

test_that('ttest works', {
ttestBF(ToothGrowth$len, ToothGrowth$dose)
ttestBF(formula=len~supp, data=ToothGrowth)
})

test_that('rejects bad input', {
expect_error(
ttestBF(formula=len~dose, data=ToothGrowth),
'Indep. groups t test requires a factor with exactly 2 levels.',
fixed=TRUE
)
expect_error(
ttestBF(formula=len~dose+supp, data=ToothGrowth),
'Indep. groups t test can only support 1 factor as predictor.',
fixed=TRUE
)
expect_error(
ttestBF(formula=len~dose:supp, data=ToothGrowth),
'Interaction terms are not allowed in t test.',
fixed=TRUE
)
})

0 comments on commit 3cfa7bf

Please sign in to comment.