test/unit/train.rb in ierail-0.3.5 vs test/unit/train.rb in ierail-0.4.0
- old
+ new
@@ -1,16 +1,21 @@
$:.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
+
+ VCR.configure do |c|
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
+ c.hook_into :webmock
+ end
+
+ VCR.use_cassette('trains') do
+ @train = ir.trains.sample #Use a random station
+ end
end
def test_that_a_train_has_status
refute_empty @train.status
end
@@ -30,10 +35,10 @@
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
+ refute_nil @train.date
end
def test_that_a_train_has_a_message
refute_empty @train.message
end