spec/timespan_spec.rb in timespan-0.2.4 vs spec/timespan_spec.rb in timespan-0.2.5
- old
+ new
@@ -4,9 +4,22 @@
subject { timespan }
let(:from) { Chronic.parse("1 day ago") }
let(:to) { Time.now }
+ context 'Invalid params' do
+ describe 'error msg' do
+ specify do
+ expect { Timespan.new }.to raise_error(ArgumentError)
+ end
+
+ specify do
+ expect { Timespan.new(nil) }.to raise_error(ArgumentError)
+ end
+ end
+ end
+
+
context '2 days duration (from now - default)' do
let(:timespan) { Timespan.new :duration => "2 days"}
describe '.start_date' do
it 'should default to today' do