Skip to content

Commit

Permalink
Add test for schedule across end of year
Browse files Browse the repository at this point in the history
  • Loading branch information
svoop committed Jan 14, 2024
1 parent 2410da2 commit 67ddab2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def schedule
date_range_with_exception: '05-18 1130-1330 EXC FRI',
date_across_midnight: '08 29 2100-0600',
date_range_with_month: 'FEB 01-MAR 31 0700-1100',
date_range_across_end_of_year: 'DEC 30-JAN 02 H24',
day: 'MON 0700-1900',
days: 'MON WED FRI 0700-1900',
day_range: 'MON-TUE 0700-1900',
Expand Down
12 changes: 12 additions & 0 deletions spec/lib/notam/schedule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@
end
end

it "must extract schedule :date_range_across_end_of_year" do
schedules = NOTAM::Schedule.parse(NOTAM::Factory.schedule[:date_range_across_end_of_year], base_date: base_date)
_(schedules.count).must_equal 1
schedules[0].then do |subject|
_(subject.actives).must_be_instance_of NOTAM::Schedule::Dates
_(subject.actives).must_equal [(AIXM.date('2000-12-30')..AIXM.date('2001-01-02'))]
_(subject.times).must_equal [(AIXM.time('00:00')..AIXM.time('24:00'))]
_(subject.inactives).must_be_instance_of NOTAM::Schedule::Days
_(subject.inactives).must_be :empty?
end
end

it "must extract schedule :day" do
schedules = NOTAM::Schedule.parse(NOTAM::Factory.schedule[:day], base_date: base_date)
_(schedules.count).must_equal 1
Expand Down

0 comments on commit 67ddab2

Please sign in to comment.