spec/lib/moments_spec.rb in moments-0.0.1.alpha vs spec/lib/moments_spec.rb in moments-0.0.2.alpha
- old
+ new
@@ -1,5 +1,6 @@
+require 'spec_helper'
require_relative '../../lib/moments.rb'
describe Moments do
context 'calculates the distance between two given times' do
let(:from) do
@@ -14,8 +15,14 @@
expect do
Moments.difference(from, to)
end.to_not raise_error
Moments.difference(from, to).should be_a Moments::Difference
+ end
+
+ it '#difference should raise an error if :from is greater than :to' do
+ expect do
+ Moments.difference(to, from)
+ end.to raise_error
end
end
end