-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathutilities_spec.rb
More file actions
27 lines (21 loc) · 793 Bytes
/
utilities_spec.rb
File metadata and controls
27 lines (21 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'rspec'
require_relative 'code_event.rb'
require_relative 'utilities.rb'
describe "assert_date_sorted" do
include RepoDepot::InstanceMethods
it "doesn't throw when dates are in order" do
events = [CodeEvent.new(date: '1/1/2011'),
CodeEvent.new(date: '2/1/2011')]
lambda { assert_date_sorted(events) }.should_not raise_error
end
it "throws when dates of events are not in order" do
events = [CodeEvent.new(date: '2/1/2011'),
CodeEvent.new(date: '1/1/2011')]
lambda { assert_date_sorted(events) }.should raise_error
end
it "ignores events without dates" do
events = [CodeEvent.new(complexity: 2.1),
CodeEvent.new(date: '2/1/2011')]
lambda { assert_date_sorted(events) }.should_not raise_error
end
end