SUZUKI Miho
null+****@clear*****
Mon Nov 26 21:13:51 JST 2012
SUZUKI Miho 2012-11-26 21:13:51 +0900 (Mon, 26 Nov 2012) New Revision: 603dbd33873a54d7fa10784e0f8a0ea9b3270033 https://github.com/logaling/logaling-command/commit/603dbd33873a54d7fa10784e0f8a0ea9b3270033 Merged 5506589: Merge pull request #91 from logaling/fix-index-personal-glossary Log: Add spec for #create_personal_repository Modified files: spec/logaling/repository_spec.rb Modified: spec/logaling/repository_spec.rb (+40 -0) =================================================================== --- spec/logaling/repository_spec.rb 2012-11-26 17:33:02 +0900 (634d08c) +++ spec/logaling/repository_spec.rb 2012-11-26 21:13:51 +0900 (01225a6) @@ -196,6 +196,46 @@ module Logaling end end + describe "#create_personal_repository" do + let(:glossary_name) { "personal_project" } + let(:source_language) { "en" } + let(:target_language) { "ja" } + before do + FileUtils.rm_rf(File.join(logaling_home, 'personal'), :secure => true) + repository.create_personal_project(glossary_name, source_language, target_language) + end + + context "when just create personal project" do + before do + glossary = repository.find_glossary(glossary_name, source_language, target_language) + Logaling::GlossaryDB.open(repository.logaling_db_home, "utf8") do |db| + @ret = db.glossary_source_exist?(glossary.glossary_source) + end + end + + it "should not be indexed on db" do + @ret.should be_false + end + end + + context "when create personal project and index" do + before do + glossary = repository.find_glossary(glossary_name, source_language, target_language) + glossary.index! + Logaling::GlossaryDB.open(repository.logaling_db_home, "utf8") do |db| + @ret = db.glossary_source_exist?(glossary.glossary_source) + end + end + + it "should be indexed on db" do + @ret.should be_true + end + end + after do + repository.remove_personal_project(glossary_name, source_language, target_language) + end + end + describe "#remove_personal_project" do let(:rm_glossary_name) { "rm_personal_project" } let(:rm_source_language) { "en" } -------------- next part -------------- An HTML attachment was scrubbed... Download