-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathactivity_spec.rb
55 lines (42 loc) · 964 Bytes
/
activity_spec.rb
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# frozen_string_literal: true
require "date"
require "./test/helper"
require "./test/add_event_helper"
clean_describe "add activity" do
let(:content) { CONTENT }
describe "date ordering" do
let(:content) do
<<-FILE
### Activities:
- 2018-01-01: Activity one year later.
- 2017-01-01: Activity 1.
- 2016-01-01: Activity one year earlier.
### Notes:
### Friends:
### Locations:
FILE
end
subject do
4.times do |i|
run_cmd("add activity 2017-01-01: Activity #{i + 2}.")
end
end
it "orders dates by insertion time" do
subject
value(File.read(filename)).must_equal <<-FILE
### Activities:
- 2018-01-01: Activity one year later.
- 2017-01-01: Activity 5.
- 2017-01-01: Activity 4.
- 2017-01-01: Activity 3.
- 2017-01-01: Activity 2.
- 2017-01-01: Activity 1.
- 2016-01-01: Activity one year earlier.
### Notes:
### Friends:
### Locations:
FILE
end
end
parsing_specs(event: :activity)
end