test/unit/station.rb in ierail-0.3.5 vs test/unit/station.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 StationTest < MiniTest::Unit::TestCase
def setup
ir = IERail.new
- @station = ir.stations.sample #Use a random station
+
+ VCR.configure do |c|
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
+ c.hook_into :webmock
+ end
+
+ VCR.use_cassette('stations') do
+ @station = ir.stations.sample #Use a random station
+ end
end
def test_that_a_station_has_a_description
refute_empty @station.description
end
@@ -35,9 +40,9 @@
def test_that_a_station_has_a_code
refute_empty @station.code
end
def test_that_a_stations_has_an_id
- refute_empty @station.id
+ refute_nil @station.id
end
end