Sha256: 2b4d681e01fc6372ae80593756aa2b3b4fe4d9ce12d263c3456fb7f0b13849d2

Contents?: true

Size: 933 Bytes

Versions: 38

Compression:

Stored size: 933 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)
})

print("All tests passed!")

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
trackler-2.1.0.19 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.18 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.17 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.16 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.15 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.14 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.13 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.12 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.11 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.10 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.9 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.8 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.7 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.6 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.5 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.4 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.3 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.2 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.1 tracks/r/exercises/space-age/test_space-age.R
trackler-2.1.0.0 tracks/r/exercises/space-age/test_space-age.R