-
Notifications
You must be signed in to change notification settings - Fork 207
/
Copy pathmemorize_spec.rb
47 lines (33 loc) · 1.22 KB
/
memorize_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
# $:.unshift "spec/"
# require './spec/spec_helper'
# require 'json'
# %w"path tree".each {|o| require "xiki/core/#{o}"}
# # %w"path code tree menu menu_suggester pre_pattern pattern file_tree bookmarks".each {|o| require "xiki/core/#{o}"}
# require_relative '../menu/memorize.rb'
# # describe Memorize, "#expand" do
# describe Memorize, "#propagate_edits" do
# it "updates when just question" do
# txt = Tree.children(Memorize::MENU_HIDDEN.unindent, "test/deserialize/").gsub /^: /, ''
# o = Memorize.new txt
# o.propagate_edits
# o.pending[3].should == "Japana : Tokyo"
# end
# it "updates when just question and answer" do
# txt = Tree.children(Memorize::MENU_HIDDEN.unindent, "test/deserialize/").gsub /^: /, ''
# txt.sub! "___", "Tokistan"
# o = Memorize.new txt
# o.propagate_edits
# o.pending[3].should == "Japana : Tokistan"
# end
# end
# describe Memorize, "#deserialize" do
# it "works" do
# txt = Tree.children(Memorize::MENU_HIDDEN.unindent, "test/deserialize/").gsub /^: /, ''
# Ol.a txt
# o = Memorize.new
# o.deserialize txt
# o.heading.should == ["> Example"]
# o.completed.length.should == 3
# o.progress.should == [[3, 1, 2], []]
# end
# end