Sha256: bb82220aec077f62a0c955a6d47ef358c137d7ef9df95269635a5f76bd570b05
Contents?: true
Size: 979 Bytes
Versions: 18
Compression:
Stored size: 979 Bytes
Contents
module TimeBoss class Calendar describe Quarter do let(:calendar) { instance_double(TimeBoss::Calendar) } let(:start_date) { Date.parse('2019-09-30') } let(:end_date) { Date.parse('2019-12-29') } let(:subject) { described_class.new(calendar, 2019, 4, start_date, end_date) } it 'knows its stuff' do expect(subject.name).to eq '2019Q4' expect(subject.start_date).to eq start_date expect(subject.end_date).to eq end_date expect(subject.to_range).to eq start_date..end_date end it 'can stringify itself' do expect(subject.to_s).to include('2019Q4', start_date.to_s, end_date.to_s) end describe '#current?' do it 'knows when it is' do allow(Date).to receive(:today).and_return start_date expect(subject).to be_current end it 'knows when it is not' do expect(subject).not_to be_current end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems