spec/blather/stanza/pubsub/unsubscribe_spec.rb in blather-0.6.2 vs spec/blather/stanza/pubsub/unsubscribe_spec.rb in blather-0.7.0

- old
+ new

@@ -1,74 +1,74 @@ require 'spec_helper' require 'fixtures/pubsub' describe Blather::Stanza::PubSub::Unsubscribe do it 'registers itself' do - Blather::XMPPNode.class_from_registration(:unsubscribe, 'http://jabber.org/protocol/pubsub').must_equal Blather::Stanza::PubSub::Unsubscribe + Blather::XMPPNode.class_from_registration(:unsubscribe, 'http://jabber.org/protocol/pubsub').should == Blather::Stanza::PubSub::Unsubscribe end it 'can be imported' do - Blather::XMPPNode.import(parse_stanza(unsubscribe_xml).root).must_be_instance_of Blather::Stanza::PubSub::Unsubscribe + Blather::XMPPNode.parse(unsubscribe_xml).should be_instance_of Blather::Stanza::PubSub::Unsubscribe end it 'ensures an unsubscribe node is present on create' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node', 'jid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty + unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty end it 'ensures an unsubscribe node exists when calling #unsubscribe' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node', 'jid' unsubscribe.pubsub.remove_children :unsubscribe - unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).must_be_empty + unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).should be_empty - unsubscribe.unsubscribe.wont_be_nil - unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty + unsubscribe.unsubscribe.should_not be_nil + unsubscribe.find('//ns:pubsub/ns:unsubscribe', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty end it 'defaults to a set node' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node', 'jid' - unsubscribe.type.must_equal :set + unsubscribe.type.should == :set end it 'sets the host if requested' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'pubsub.jabber.local', 'node', 'jid' - unsubscribe.to.must_equal Blather::JID.new('pubsub.jabber.local') + unsubscribe.to.should == Blather::JID.new('pubsub.jabber.local') end it 'sets the node' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node-name', 'jid' - unsubscribe.node.must_equal 'node-name' + unsubscribe.node.should == 'node-name' end it 'has a node attribute' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node-name', 'jid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@node="node-name"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.node.must_equal 'node-name' + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@node="node-name"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.node.should == 'node-name' unsubscribe.node = 'new-node' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@node="new-node"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.node.must_equal 'new-node' + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@node="new-node"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.node.should == 'new-node' end it 'has a jid attribute' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node-name', 'jid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@jid="jid"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.jid.must_equal Blather::JID.new('jid') + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@jid="jid"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.jid.should == Blather::JID.new('jid') unsubscribe.jid = Blather::JID.new('n@d/r') - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@jid="n@d/r"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.jid.must_equal Blather::JID.new('n@d/r') + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@jid="n@d/r"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.jid.should == Blather::JID.new('n@d/r') end it 'has a subid attribute' do unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node-name', 'jid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="subid"]', :ns => Blather::Stanza::PubSub.registered_ns).must_be_empty + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="subid"]', :ns => Blather::Stanza::PubSub.registered_ns).should be_empty unsubscribe = Blather::Stanza::PubSub::Unsubscribe.new :set, 'host', 'node-name', 'jid', 'subid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="subid"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.subid.must_equal 'subid' + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="subid"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.subid.should == 'subid' unsubscribe.subid = 'newsubid' - unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="newsubid"]', :ns => Blather::Stanza::PubSub.registered_ns).wont_be_empty - unsubscribe.subid.must_equal 'newsubid' + unsubscribe.find('//ns:pubsub/ns:unsubscribe[@subid="newsubid"]', :ns => Blather::Stanza::PubSub.registered_ns).should_not be_empty + unsubscribe.subid.should == 'newsubid' end end