Pushing all changes

This commit is contained in:
2025-12-19 09:16:48 -07:00
parent b8f54b44a3
commit 4737531805
7 changed files with 105 additions and 13 deletions
+13
View File
@@ -147,4 +147,17 @@ RSpec.describe Universe do
expect(universe.planets.length).to eq 18
end
end
describe '#tick' do
it 'runs a tick of the game' do
universe.create_universe
player_1 = Player.new('test player 01')
universe.add_player(player_1)
universe.add_ship(player_1, Position.new(3, 5))
ships = universe.get_player_ships(player_1)
universe.move_ship(player_1, ships[0], Position.new(2, 4))
# Now we tick the universe and the ship should move a little and the player should gain resources.
expect{universe.tick}.to_not raise_error()
end
end
end