Add basic Period class

This commit is contained in:
Dzmitry Plashchynski
2015-03-01 16:06:10 +02:00
parent ab9285ce0b
commit b3a26ba7d3
7 changed files with 39 additions and 1 deletions

18
spec/period_spec.rb Normal file
View File

@@ -0,0 +1,18 @@
require "spec_helper"
describe Periodicity::Period do
around(:each) do |example|
Timecop.freeze do
example.run
end
end
describe "#next" do
context "in daily basis" do
it "should return the time 2 days from now" do
@period = Periodicity::Period.new(2.day)
expect(@period.next).to be_eql(2.day.from_now)
end
end
end
end