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