test/stanza/iq/version_test.rb in vines-0.3.2 vs test/stanza/iq/version_test.rb in vines-0.4.0

- old
+ new

@@ -1,17 +1,18 @@ # encoding: UTF-8 +require 'tmpdir' require 'vines' require 'ext/nokogiri' require 'minitest/autorun' class VersionTest < MiniTest::Unit::TestCase def setup @stream = MiniTest::Mock.new @config = Vines::Config.new do host 'wonderland.lit' do - storage(:fs) { dir '.' } + storage(:fs) { dir Dir.tmpdir } end end end def test_to_address_routes @@ -19,11 +20,10 @@ node = node(%q{<iq id="42" to="romeo@verona.lit" type="get"><query xmlns="jabber:iq:version"/></iq>}) router = MiniTest::Mock.new router.expect(:route, nil, [node]) - @stream.expect(:domain, 'wonderland.lit') @stream.expect(:config, @config) @stream.expect(:user, alice) @stream.expect(:router, router) stanza = Vines::Stanza::Iq::Version.new(node, @stream) @@ -34,9 +34,10 @@ def test_version_get_returns_result alice = Vines::User.new(:jid => 'alice@wonderland.lit/tea') node = node(%q{<iq id="42" type="get"><query xmlns="jabber:iq:version"/></iq>}) + @stream.expect(:config, @config) @stream.expect(:user, alice) @stream.expect(:domain, 'wonderland.lit') expected = node(%Q{ <iq from="wonderland.lit" id="42" to="alice@wonderland.lit/tea" type="result">