Sha256: 0d467e7d7ef61d58b1d1ce8648c89a83af9fa9cc0480f459f744ca6f2e13447b

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift '../lib'

require 'test/unit'
require 'xmpp4r/rexmladdons'
require 'xmpp4r/query'
include Jabber

class IqQueryTest < Test::Unit::TestCase
  def test_create
    x = IqQuery.new()
    assert_equal("query", x.name)
    assert_equal("<query/>", x.to_s)
  end

  def test_import
    q = IqQuery.new
    assert_equal(IqQuery, q.class)

    e = REXML::Element.new('query')
    e.add_namespace('jabber:iq:roster')
    # kind_of? only checks that the class belongs to the IqQuery class
    # hierarchy. See IqQueryRosterTest#test_import for a more strict
    # check.
    assert_kind_of(IqQuery, IqQuery.import(e))

    # Importing specific derivates is to be tested in the test case of the derivate
    # (e.g. tc_iqqueryroster.rb)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gmcmillan-xmpp4r-0.6.2 test/tc_iqquery.rb
gmcmillan-xmpp4r-0.6.1 test/tc_iqquery.rb
gmcmillan-xmpp4r-0.6 test/tc_iqquery.rb
gmcmillan-xmpp4r-0.5 test/tc_iqquery.rb