Sha256: 25943750831e7d93184b2c04f0c4115d6adfcd60ecec48f108e38ec7b3dd7769
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
require 'spec_helper' describe FileScheduler::TimeMark do let(:time) { Time.now } def mark(attributes = {}) attributes = attributes.attributes if attributes.respond_to?(:attributes) FileScheduler::TimeMark.new attributes end describe "#matches?" do RSpec::Matchers.define :match do |time| match do |mark| mark.matches? time end end it "should match a Time when all defined attributes are equal" do mark(time).should match(time) end it "should not match a Time when an attribute is diffirent" do mark(time.attributes.merge(:month => time.month + 1)).should_not match(time) end it "should match week day" do mark(time.attributes(:week_day)).should match(time) end end describe "#<=>" do it "should be smaller when all attributes are equal or smaller" do mark(time).should < time + 60 end it "should be equal when all attributes are equal" do mark(time).should == time end it "should be higher when all attributes are equal or higher" do mark(time).should > time - 60 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
file_scheduler-0.0.2 | spec/lib/file_scheduler/time_mark_spec.rb |