wrote basic building stuff, need to impliment more in the player.
This commit is contained in:
@@ -70,7 +70,7 @@ module Game
|
||||
|
||||
it 're-connects the player and returns success' do
|
||||
cmd = { 'payload' => { 'player_id' => player_id, 'faction' => 'good' } }
|
||||
expect(game.player_connect(client_socket, cmd)).to eq('status' => 'success')
|
||||
expect(game.player_connect(client_socket, cmd)).to eq({"payload"=>"success", "type"=>"update"})
|
||||
expect(existing_player).to have_received(:connect).with(client_socket)
|
||||
end
|
||||
end
|
||||
@@ -103,7 +103,7 @@ module Game
|
||||
it 'creates a new player, connects them, and adds them to #players' do
|
||||
cmd = { 'payload' => { 'player_id' => player_id, 'faction' => 'evil'} }
|
||||
response = game.player_connect(client_socket, cmd)
|
||||
expect(response).to eq('status' => 'success')
|
||||
expect(response).to eq({"payload"=>"success", "type"=>"update"})
|
||||
expect(game.players).to include(an_object_having_attributes(player_id:))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user