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.0.8.55 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.54 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.53 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.52 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.51 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.50 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.49 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.48 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.47 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.46 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.45 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.44 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.43 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.42 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.41 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.40 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.39 tracks/r/exercises/space-age/test_space-age.R
trackler-2.0.8.38 tracks/r/exercises/space-age/test_space-age.R