$:.unshift(File.join(File.dirname(__FILE__), '..','..', 'lib')) require_relative 'helper' require 'minitest/autorun' require 'ierail' class TrainTest < MiniTest::Unit::TestCase def setup ir = IERail.new @train = ir.trains.sample #Use a random train end def test_that_a_train_has_status refute_empty @train.status end def test_that_a_train_has_a_location refute_empty @train.location end def test_that_a_trains_location_is_an_array assert_equal @train.location.class, Array end def test_that_the_location_array_contains_only_two_values assert_equal @train.location.size, 2 end def test_that_a_train_has_a_code refute_empty @train.code end def test_that_a_train_has_a_date refute_empty @train.date end def test_that_a_train_has_a_message refute_empty @train.message end def test_that_a_train_has_a_direction refute_empty @train.direction end end