|
19 | 19 | @template.published_at.should == Time.local(1999, 12, 25, 22, 30) |
20 | 20 | end |
21 | 21 |
|
| 22 | + it "honours any parsing (of Time) that yaml may do on the 'published' meta-field" do |
| 23 | + @template.meta["published"] = Time.local(1999, 12, 25, 22, 30) |
| 24 | + @template.published_at.should == Time.local(1999, 12, 25, 22, 30) |
| 25 | + end |
| 26 | + |
| 27 | + it "honours any parsing (to Date) of time that yaml may do on the 'published' meta-field" do |
| 28 | + @template.meta["published"] = Date.new(1999, 12, 25) |
| 29 | + @template.published_at.should == Time.local(1999, 12, 25) |
| 30 | + end |
| 31 | + |
22 | 32 | end |
23 | 33 |
|
24 | 34 | describe "#updated_at" do |
|
30 | 40 |
|
31 | 41 | it "can be overridden with an 'updated' meta-field" do |
32 | 42 | @template.meta["published"] = "25 Dec 1999 22:30" |
33 | | - @template.meta["published"] = "1 Jan 2000 03:00" |
| 43 | + @template.meta["updated"] = "1 Jan 2000 03:00" |
34 | 44 | @template.updated_at.should == Time.local(2000, 1, 1, 3, 0) |
35 | 45 | end |
| 46 | + |
| 47 | + it "honours any parsing of time that yaml may do on the 'updated' meta-field" do |
| 48 | + @template.meta["updated"] = Date.new(2000, 1, 1) |
| 49 | + @template.updated_at.should == Time.local(2000, 1, 1) |
| 50 | + end |
36 | 51 |
|
37 | 52 | end |
38 | 53 |
|
|
0 commit comments