Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 49f4fc4784
Fetching contributors…

Cannot retrieve contributors at this time

91 lines (84 sloc) 8.138 kb
 +----- Report ---------------------------------------------------------------+
| |
| Calendar::Term  - |
| #number  PASS |
| #semester  PASS |
| #include?  PASS |
| Returns false on weekends  PASS |
| #number_of_weeks  PASS |
| #date(week: 7, day: 2) etc.  PASS |
| Raises error on invalid input  PASS |
| Returns nil if week is not in term  PASS |
| #week_and_day  PASS |
| Returns nil if argument is not in term  PASS |
| Some tests on a pathological term  PASS |
| Error on stupid input  - |
| Term outside 1..4  PASS |
| Start date after finish date  PASS |
| |
| Calendar::Semester  - |
| #number  PASS |
| #include?  PASS |
| #number_of_weeks  PASS |
| #date(week: 7, day: 2) etc.  PASS |
| Handles the irregular start and end of term  PASS |
| #week_and_day  PASS |
| Returns nil if date is not in semester  PASS |
| |
| Calendar  - |
| Setting and resetting the value of 'today'  PASS |
| #schoolday  - |
| Test in Semester 1 2012  - |
| today  PASS |
| 2012-02-16  PASS |
| yesterday  PASS |
| Monday  PASS |
| Fri  PASS |
| 12B Thu (and Thu 12B)  FAIL |
| Thu 12B Sem2 and permutations  FAIL |
| Error for incomplete or invalid input  ERROR |
| nil for days that are not school days  PASS |
| Brief test in Semester 2 2012  - |
| |
 +----------------------------------------------------------------------------+
FAIL: 12B Thu (and Thu 12B)
test/calendar.rb
245 end
246 D "12B Thu (and Thu 12B)" do
=> 247 Eq @cal.schoolday("12B Thu").sem_date(true), "Sem1 T...
248 Eq @cal.schoolday("12B Thu").date, Date.new(2012, 5,...
249 Eq @cal.schoolday("Thu 12B").sem_date(true), "Sem1 T...
Equality test failed
Was: "Sem1 Thu 5A"
Should be: "Sem1 Thu 12B"
Backtrace
test/calendar.rb:247:in `block (4 levels) in <top (required)>'
FAIL: Thu 12B Sem2 and permutations
test/calendar.rb
251 end
252 D "Thu 12B Sem2 and permutations" do
=> 253 Eq @cal.schoolday("Sem2 12B Thu").date, Date.new(201...
254 Eq @cal.schoolday("Sem2 Thu 12B").date, Date.new(201...
255 Eq @cal.schoolday("12B Thu Sem2").date, Date.new(201...
Equality test failed
Was: #<Date: 2012-03-01 ((2455988j,0s,0n),+0s,2299161j)>
Should be: #<Date: 2012-10-18 ((2456219j,0s,0n),+0s,2299161j)>
Backtrace
test/calendar.rb:253:in `block (4 levels) in <top (required)>'
ERROR: Error for incomplete or invalid input
test/calendar.rb
259 end
260 D "Error for incomplete or invalid input" do
=> 261 E(SR::SRError) { @cal.schoolday("12B") }
262 E(SR::SRError) { @cal.schoolday("Sem1") }
263 E(SR::SRError) { @cal.schoolday("xyz") }
 Class: NoMethodError
 Message: undefined method `semester' for #<SchoolRecord::Calendar:0x00000100843d60>
Backtrace
./lib/school_record/calendar.rb:306:in `parse'
./lib/school_record/calendar.rb:189:in `schoolday'
test/calendar.rb:261:in `block (5 levels) in <top (required)>'
test/calendar.rb:261:in `block (4 levels) in <top (required)>'
================================================================================
FAIL #pass: 27 #fail: 2 #error: 1 assertions: 150 time: 0.086
================================================================================
Jump to Line
Something went wrong with that request. Please try again.