mirror of
https://github.com/michaeldv/pit.git
synced 2025-12-11 08:53:01 +00:00
More work with notes; refactored actions; added tests
This commit is contained in:
54
test/pit_date.rb
Normal file
54
test/pit_date.rb
Normal file
@@ -0,0 +1,54 @@
|
||||
module Pit
|
||||
module Date
|
||||
|
||||
def should_parse_alpha_dates
|
||||
`#{@pit} project -c test`
|
||||
`#{@pit} task -c test -d "dec 1, 2011 19:30"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2011 19:30/m
|
||||
`#{@pit} task -c test -d "dec 1, 2012 1:15pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2012 13:15/m
|
||||
`#{@pit} task -c test -d "dec 1, 2013 11"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 11:00/m
|
||||
`#{@pit} task -c test -d "dec 1, 2013 7pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 19:00/m
|
||||
`#{@pit} task -c test -d "dec 1, 2013"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 /m
|
||||
`#{@pit} task -c test -d "dec 1 5:55"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} 05:55/m
|
||||
`#{@pit} task -c test -d "dec 1 2:40pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} 14:40/m
|
||||
# `#{@pit} task -c test -d "dec 1 5"`
|
||||
# `#{@pit} task`.should.match /Dec 01, #{Time.now.year} 05:00/m
|
||||
# `#{@pit} task -c test -d "dec 1 3pm"`
|
||||
# `#{@pit} task`.should.match /Dec 01, #{Time.now.year} 15:00/m
|
||||
`#{@pit} task -c test -d "dec 1"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} /m
|
||||
end
|
||||
|
||||
def should_parse_slash_dates
|
||||
`#{@pit} project -c test`
|
||||
`#{@pit} task -c test -d "12/1/2011 19:30"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2011 19:30/m
|
||||
`#{@pit} task -c test -d "12/1/2012 1:15pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2012 13:15/m
|
||||
`#{@pit} task -c test -d "12/1/2013 11"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 11:00/m
|
||||
`#{@pit} task -c test -d "12/1/2013 7pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 19:00/m
|
||||
`#{@pit} task -c test -d "12/1/2013"`
|
||||
`#{@pit} task`.should.match /Dec 01, 2013 /m
|
||||
`#{@pit} task -c test -d "12/1 5:55"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} 05:55/m
|
||||
`#{@pit} task -c test -d "12/1 2:40pm"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} 14:40/m
|
||||
# `#{@pit} task -c test -d "12/1 5"`
|
||||
# `#{@pit} task`.should.match /Dec 01, #{Time.now.year} 05:00/m
|
||||
# `#{@pit} task -c test -d "12/1 3pm"`
|
||||
# `#{@pit} task`.should.match /Dec 01, #{Time.now.year} 15:00/m
|
||||
`#{@pit} task -c test -d "12/1"`
|
||||
`#{@pit} task`.should.match /Dec 01, #{Time.now.year} /m
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user