Pushing all changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user