prkwars 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/spec/player_spec.rb +30 -0
- data/spec/spec_helper.rb +7 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be17ea11de9dc8c7b62aacb87747f7d3cfe8b43e
|
|
4
|
+
data.tar.gz: '09d38b095375ec612d6d2338960c0183b3234fa1'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7e6de2138e93758bd5effbbf8d04f0445a648457c08a9d5032a1cf04c109a178c2faae78dd0bd3c03c8b6f3bf82b4a679488dd316857147cabc5445fd37b5a7
|
|
7
|
+
data.tar.gz: b022f3dd68b3a998f50bb7fb5b5c22af3d0e393e96a5e37a5d278d269de65f16ccf0ec3227d78f960335957873817e9d1cd2fc83fa26bba41260d752d6c92068
|
data/spec/player_spec.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
$LOAD_PATH << './'
|
|
2
|
+
require_relative './spec_helper.rb'
|
|
3
|
+
require 'chingu'
|
|
4
|
+
require 'rspec'
|
|
5
|
+
|
|
6
|
+
describe 'Player' do
|
|
7
|
+
include GamespacePersistence
|
|
8
|
+
before :all do
|
|
9
|
+
@game = Game.new
|
|
10
|
+
@game.push_game_state(Play)
|
|
11
|
+
@play = @game.current_game_state
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
context 'position' do
|
|
15
|
+
it 'spawns inside gamespace' do
|
|
16
|
+
expect(in_bounds(@play.player, @play.gamespace)).to eq(true)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'never moves outside of gamespace' do
|
|
20
|
+
1000.times { @play.player.move_up; @play.player.update }
|
|
21
|
+
expect(in_bounds(@play.player, @play.gamespace)).to eq(true)
|
|
22
|
+
1000.times { @play.player.move_up; @play.player.update }
|
|
23
|
+
expect(in_bounds(@play.player, @play.gamespace)).to eq(true)
|
|
24
|
+
1000.times { @play.player.move_left; @play.player.update }
|
|
25
|
+
expect(in_bounds(@play.player, @play.gamespace)).to eq(true)
|
|
26
|
+
1000.times { @play.player.move_down; @play.player.update }
|
|
27
|
+
expect(in_bounds(@play.player, @play.gamespace)).to eq(true)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prkwars
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marek Pikna
|
|
@@ -44,6 +44,8 @@ files:
|
|
|
44
44
|
- media/stalker.png
|
|
45
45
|
- media/turrets.png
|
|
46
46
|
- media/warp.png
|
|
47
|
+
- spec/player_spec.rb
|
|
48
|
+
- spec/spec_helper.rb
|
|
47
49
|
homepage: http://rubygems.org/gems/prkwars
|
|
48
50
|
licenses:
|
|
49
51
|
- MIT
|