Sha256: adfee6c8baa21a332c63ec47e14d48c9d293b7dfdbb2f8e9823002e6b7d28dac
Contents?: true
Size: 1.17 KB
Versions: 6
Compression:
Stored size: 1.17 KB
Contents
require "spec_helper" describe RTanque do context 'face-off' do before(:each) { @winner = brain_bot { self.command.fire(RTanque::Bot::MAX_GUN_ENERGY) } @looser = brain_bot { } @winner.position = RTanque::Point.new(0, 0, @arena) @winner.turret.heading = RTanque::Heading.new(RTanque::Heading::N) @looser.position = RTanque::Point.new(0, @arena.height, @arena) @match = RTanque::Match.new(@arena, 1000) @match.add_bots(@winner, @looser) } it 'winner bot should win' do @match.start expect(@match.bots.to_a).to eq [@winner] expect(@match.ticks).to be < @match.max_ticks expect(@winner.health).to be(RTanque::Configuration.bot.health.max) expect(@looser.health).to be <= RTanque::Configuration.bot.health.min end it 'no bot should win' do @winner.turret.heading = RTanque::Heading.new(RTanque::Heading::E) @match.start expect(@match.bots.to_a).to eq [@winner, @looser] expect(@match.ticks).to be(@match.max_ticks) expect(@winner.health).to be(RTanque::Configuration.bot.health.max) expect(@looser.health).to be(RTanque::Configuration.bot.health.max) end end end
Version data entries
6 entries across 6 versions & 2 rubygems