Sha256: edce8542e1ae16f5544e8cf9a54272e1481a7eb856d1bcebc5979fa233fe3a12

Contents?: true

Size: 959 Bytes

Versions: 140

Compression:

Stored size: 959 Bytes

Contents

source("./space-age.R")
library(testthat)

test_that("Age on Earth", {
  seconds <- 1000000000
  expect_equal(space_age(seconds, "earth"), 31.69)
})

test_that("Age on Mercury", {
  seconds <- 2134835688
  expect_equal(space_age(seconds, "mercury"), 280.88)
})

test_that("Age on Venus", {
  seconds <- 189839836
  expect_equal(space_age(seconds, "venus"), 9.78)
})

test_that("Age on Mars", {
  seconds <- 2329871239
  expect_equal(space_age(seconds, "mars"), 39.25)
})

test_that("Age on Jupiter", {
  seconds <- 901876382
  expect_equal(space_age(seconds, "jupiter"), 2.41)
})

test_that("Age on Saturn", {
  seconds <- 3000000000
  expect_equal(space_age(seconds, "saturn"), 3.23)
})

test_that("Age on Uranus", {
  seconds <- 3210123456
  expect_equal(space_age(seconds, "uranus"), 1.21)
})

test_that("Age on Neptune", {
  seconds <- 8210123456
  expect_equal(space_age(seconds, "neptune"), 1.58)
})

message("All tests passed for exercise: space-age")

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
trackler-2.2.1.126 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.125 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.124 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.123 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.122 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.121 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.120 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.119 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.118 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.117 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.116 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.115 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.114 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.113 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.111 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.110 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.109 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.108 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.107 tracks/r/exercises/space-age/test_space-age.R
trackler-2.2.1.106 tracks/r/exercises/space-age/test_space-age.R