# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. # License: Apache License, Version 2.0 require File.dirname(__FILE__) + '/../spec_helper' module RTM::Topic describe self do before(:each) do @tm = get_used_tm_sys_tm @tm.should be_a_kind_of RTM::TopicMap end after(:each) do if implementation_for_spec == :majortom_db @tm.remove else @tm.close end end describe "#best_label" do it "should be avaiable to majortom topics" do t = @tm.get!("a_topic") t.should be_a_kind_of RTM::Topic t.should respond_to(:best_label) end end describe "#read_only?" do it "should give back true if topic is existing" do topic = @tm.get!("something") topic.should_not be_nil topic.should be_a_kind_of RTM::Topic topic.read_only?.should_not be_true end it "should give back fase if topic is removed" do @tm.clear @tm.disable_revision_management topic = @tm.get!("something") topic.should_not be_nil topic.should be_a_kind_of RTM::Topic @tm.enable_revision_management topic.remove topic = @tm.revision_index.first_revision.changeset.first.old_value topic.should be_a_kind_of RTM::Topic topic.read_only?.should be_true end end end # of describe self end