tests/cimi/test_helper.rb
# Perform basic collection checks; +model_name+ is the name of the
# method returning the collection model
Perform basic collection checks; +model_name+ is the name of the
method returning the collection model
Perform basic collection checks ; + model_name + is the name of the method returning the collection model
def check_collection(model_name)
      it "must have the \"id\" and \"count\" attributes" do
        coll = self.send(model_name)
        coll.count.wont_be_nil
        coll.count.to_i.must_equal coll.entries.size
        coll.id.must_be_uri
      end
      it "must have a valid id and name for each member" do
        self.send(model_name).entries.each do |entry|
          entry.id.must_be_uri
          member = fetch(entry.id)
          member.id.must_equal entry.id
          member.name.must_equal entry.name
        end
      end
    end
def check_collection ( model_name ) it "must have the \"id\" and \"count\" attributes" do coll = self . send ( model_name ) coll . count . wont_be_nil coll . count . to_i . must_equal coll . entries . size coll . id . must_be_uri end it "must have a valid id and name for each member" do self . send ( model_name ) . entries . each do | entry | entry . id . must_be_uri member = fetch ( entry . id ) member . id . must_equal entry . id member . name . must_equal entry . name end end end
Perform basic collection checks; +model_name+ is the name of the
method returning the collection model
Perform basic collection checks ; + model_name + is the name of the method returning the collection model
model_name
<not_specific>