spec/blather/roster_spec.rb in sprsquish-blather-0.4.0 vs spec/blather/roster_spec.rb in sprsquish-blather-0.4.1
- old
+ new
@@ -1,11 +1,11 @@
require File.join(File.dirname(__FILE__), *%w[.. spec_helper])
describe Blather::Roster do
before do
@stream = mock()
- @stream.stubs(:send_data)
+ @stream.stubs(:write)
@stanza = mock()
items = []; 4.times { |n| items << Blather::JID.new("n@d/#{n}r") }
@stanza.stubs(:items).returns(items)
@@ -49,22 +49,21 @@
@roster[jid].wont_be_nil
@roster[jid2].wont_be_nil
end
it 'sends a @roster addition over the wire' do
- stream = mock()
- stream.expects(:send_data)
- roster = Blather::Roster.new stream, @stanza
+ client = mock(:write => nil)
+ roster = Blather::Roster.new client, @stanza
roster.push('a@b/c')
end
it 'removes a Blather::JID' do
proc { @roster.delete 'n@d' }.must_change('@roster.items.length', :by => -1)
end
it 'sends a @roster removal over the wire' do
- stream = mock(:send_data => nil)
- roster = Blather::Roster.new stream, @stanza
+ client = mock(:write => nil)
+ roster = Blather::Roster.new client, @stanza
roster.delete('a@b/c')
end
it 'returns an item through []' do
item = @roster['n@d']