spec/osm/term_spec.rb in osm-1.2.7 vs spec/osm/term_spec.rb in osm-1.2.8
- old
+ new
@@ -51,62 +51,62 @@
it "Works out if it is completly before a date" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start => (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.before?(Date.today).should == true
- term2.before?(Date.today).should == false
- term3.before?(Date.today).should == false
+ term1.before?(Date.today).should be_true
+ term2.before?(Date.today).should be_false
+ term3.before?(Date.today).should be_false
end
it "Works out if it is completly after a date" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start => (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.after?(Date.today).should == false
- term2.after?(Date.today).should == false
- term3.after?(Date.today).should == true
+ term1.after?(Date.today).should be_false
+ term2.after?(Date.today).should be_false
+ term3.after?(Date.today).should be_true
end
it "Works out if it has passed" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start => (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.past?().should == true
- term2.past?().should == false
- term3.past?().should == false
+ term1.past?().should be_true
+ term2.past?().should be_false
+ term3.past?().should be_false
end
it "Works out if it is in the future" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start => (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.future?().should == false
- term2.future?().should == false
- term3.future?().should == true
+ term1.future?().should be_false
+ term2.future?().should be_false
+ term3.future?().should be_true
end
it "Works out if it is the current term" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start=> (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.current?().should == false
- term2.current?().should == true
- term3.current?().should == false
+ term1.current?().should be_false
+ term2.current?().should be_true
+ term3.current?().should be_false
end
it "Works out if it contains a date" do
term1 = Osm::Term.new(@attributes.merge(:start => (Date.today - 60), :finish => (Date.today - 1)))
term2 = Osm::Term.new(@attributes.merge(:start => (Date.today - 0), :finish => (Date.today + 0)))
term3 = Osm::Term.new(@attributes.merge(:start => (Date.today + 1), :finish => (Date.today + 60)))
- term1.contains_date?(Date.today).should == false
- term2.contains_date?(Date.today).should == true
- term3.contains_date?(Date.today).should == false
+ term1.contains_date?(Date.today).should be_false
+ term2.contains_date?(Date.today).should be_true
+ term3.contains_date?(Date.today).should be_false
end
it "Date helpers return false for nil dates" do
term = Osm::Term.new
term.before?(Date.today).should be_false