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