diff options
| author | Teddy Wing | 2017-06-23 16:57:49 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-06-23 16:57:49 +0200 |
| commit | 1ba9e1439ec0fce45676aa6eff04d5f9ce12a524 (patch) | |
| tree | ec4719e959aa621ef8b6cc155602ccc445a414d5 | |
| parent | 509a52c5d7d4aae55debab1bdcb8e6a0802f46ff (diff) | |
| download | chouette-core-1ba9e1439ec0fce45676aa6eff04d5f9ce12a524.tar.bz2 | |
VehicleJourney spec: Fix "uses an inclusive range" array matcher
I had used `eq` because I was copying the other tests in
`.where_departure_time_between`, but those matched only a single element
inside the array. Here, since we're maching more than one, we need to
use `match_array` in order to disregard the element order.
Didn't notice this at first because it worked on my local machine. In
fact, it continued to work even after several tries. Needed to manually
reverse the element order in order to get the test to fail. Cédric
pointed out that my test was failing on CI.
Refs #3846
| -rw-r--r-- | spec/models/chouette/vehicle_journey_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/chouette/vehicle_journey_spec.rb b/spec/models/chouette/vehicle_journey_spec.rb index 599efe683..c78ef5b33 100644 --- a/spec/models/chouette/vehicle_journey_spec.rb +++ b/spec/models/chouette/vehicle_journey_spec.rb @@ -431,7 +431,7 @@ describe Chouette::VehicleJourney, :type => :model do ') .where_departure_time_between('03:00', '04:00', allow_empty: true) .to_a - ).to eq([journey_early, journey_late]) + ).to match_array([journey_early, journey_late]) end end |
