Sha256: d38ee94268d0854c2bd9ed454861ed19744844bd379fa94e2d40e2c5974ba43f
Contents?: true
Size: 746 Bytes
Versions: 19
Compression:
Stored size: 746 Bytes
Contents
require 'test_helper' class TestJsChat < Test::Unit::TestCase include JsChatHelpers def setup @jschat = JsChatMock.new @jschat.post_init @cookie = get_cookie end def test_identify response = send_to_jschat({ 'identify' => 'alex', 'cookie' => @cookie }) assert_equal 'identified', response['display'] end def test_join response = identify_as 'alex2', '#jschat' assert JSON.parse(response)['join'] end def test_message response = identify_as 'nick', '#jschat' assert send_to_jschat({ 'cookie' => @cookie, 'send' => 'hello', 'to' => '#jschat' }, false) end private def get_cookie JSON.parse(@jschat.receive_line({ 'protocol' => 'stateless' }.to_json))['cookie'] end end
Version data entries
19 entries across 19 versions & 1 rubygems