Sha256: eef41db960e79981d4adde030cfa73145c22a96ff02f5d2f9379505f9af48409

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

# 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtm-majortom-0.3.1-java spec/common/topic_spec.rb