forked from Fusion/U-Must-Sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync_spec.rb
executable file
·53 lines (43 loc) · 1.26 KB
/
sync_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
#!/usr/bin/env ruby
#
require 'syncmain'
module InitMockEnvironment
def init
@tdmodel = TDMock.new
@localmodel = LocalModel.new
@tdmain = TDMain.new(@tdmodel, @localmodel)
end
end
describe "A mock Toodledo model" do
before(:all) do
@tdmodel = TDMock.new
end
it "should have exactly two folders" do
@tdmodel.folders.should have_exactly(2).items
end
it "should have exactly two contexts" do
@tdmodel.contexts.should have_exactly(2).items
end
it "should have exactly two tasks" do
@tdmodel.tasks.should have_exactly(2).items
end
it "should have exactly three folders after adding a new one" do
@tdmodel.createfolder("Another Folder")
@tdmodel.folders.should have_exactly(3).items
end
it "should have exactly three contexts after adding a new one" do
@tdmodel.createcontext("@awesomecontext")
@tdmodel.contexts.should have_exactly(3).items
end
it "should have exactly two folders after deleting one" do
@tdmodel.deletefolder("Folder Two")
@tdmodel.folders.should have_exactly(2).items
end
it "should have exactly two contexts after deleting one" do
@tdmodel.deletecontext("@office")
@tdmodel.contexts.should have_exactly(2).items
end
after(:all) do
@tdmodel = nil
end
end