test/unit/ierail.rb in ierail-0.4.0 vs test/unit/ierail.rb in ierail-0.4.1
- old
+ new
@@ -49,11 +49,11 @@
Timecop.freeze(time || Time.now) do
#Thirty minutes from now
thirty_mins = Time.now + (60 * 30)
time = "#{thirty_mins.hour}:#{thirty_mins.min}" # "HH:MM"
before_train = @ir.southbound_from('Dublin Connolly').before(time).sample
- assert before_train.expected_departure <= thirty_mins
+ assert before_train.expected_arrival <= thirty_mins
end
end
end
def test_that_the_after_time_constraint_works
@@ -63,11 +63,11 @@
Timecop.freeze(time || Time.now) do
#Thirty minutes from now
thirty_mins = Time.now + (60 * 30)
time = "#{thirty_mins.hour}:#{thirty_mins.min}" # "HH:MM"
after_train = @ir.southbound_from('Dublin Connolly').after(time).sample
- assert after_train.expected_departure >= thirty_mins
+ assert after_train.expected_arrival >= thirty_mins
end
end
end
def test_that_the_in_constraint_works
@@ -77,10 +77,9 @@
Timecop.freeze(time || Time.now) do
mins = 30
thirty_mins = Time.now + (60 * mins)
time = "#{thirty_mins.hour}:#{thirty_mins.min}" # "HH:MM"
southbounds = @ir.southbound_from('Dublin Connolly')
-
before_train = southbounds.before(time)
in_half_an_hour = southbounds.in(mins)
assert_equal before_train.count, in_half_an_hour.count
before_train.each_with_index { |b,i|