smagacor 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/ChangeLog +111 -0
- data/README +48 -0
- data/Rakefile +255 -0
- data/TODO +19 -0
- data/VERSION +1 -0
- data/bin/smagacor +23 -0
- data/data/smagacor/smagacor.png +0 -0
- data/data/smagacor/tictactoe/game.info +7 -0
- data/data/smagacor/tictactoe/o.png +0 -0
- data/data/smagacor/tictactoe/tictactoe.png +0 -0
- data/data/smagacor/tictactoe/tictactoe.rb +300 -0
- data/data/smagacor/tictactoe/x.png +0 -0
- data/install.rb +21 -0
- data/lib/smagacor/controller.rb +129 -0
- data/lib/smagacor/smagacor-ui.rb +230 -0
- data/setup.rb +1331 -0
- data/test/games/tictactoe/game.info +7 -0
- data/test/runtests.rb +2 -0
- data/test/smagacor/tc_controller.rb +48 -0
- metadata +69 -0
data/test/runtests.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'smagacor/controller'
|
3
|
+
|
4
|
+
module TestData
|
5
|
+
Path = 'test/games'
|
6
|
+
MockGamePath = Path + '/tictactoe'
|
7
|
+
MockGameInfoFile = MockGamePath + '/game.info'
|
8
|
+
end
|
9
|
+
|
10
|
+
class GameInfoTest < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@gi = YAML::load( File.open( TestData::MockGameInfoFile ) )
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_load_yaml
|
17
|
+
assert_instance_of( Smagacor::GameInfo, @gi )
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_save_yaml
|
21
|
+
assert_equal( @gi, YAML::load( @gi.to_s ) )
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_get_class_object
|
25
|
+
assert_equal( Test::Unit::TestCase, @gi.get_class_object )
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
class ControllerTest < Test::Unit::TestCase
|
32
|
+
|
33
|
+
def setup
|
34
|
+
@c = Smagacor::Controller.new
|
35
|
+
@c.gamespath[0..-1] = TestData::Path
|
36
|
+
@gi = YAML::load( File.open( TestData::MockGameInfoFile ) )
|
37
|
+
@gi.directory = TestData::MockGamePath
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_load_games
|
41
|
+
@c.load_games
|
42
|
+
assert_equal( @c.games[0], @gi )
|
43
|
+
@c.load_games
|
44
|
+
assert_equal( @c.games[0], @gi )
|
45
|
+
assert_equal( 1, @c.games.length )
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.4
|
3
|
+
specification_version: 1
|
4
|
+
name: smagacor
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2005-02-09
|
8
|
+
summary: A collection of small games in ruby
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: t_leitner@gmx.at
|
12
|
+
homepage: smagacor.rubyforge.org
|
13
|
+
rubyforge_project: smagacor
|
14
|
+
description: "Smagacor is a collection of some small games, like TicTacToe and Pong. Adding
|
15
|
+
new games should not be to hard, as Smagacor provides some useful classes for
|
16
|
+
games."
|
17
|
+
autorequire:
|
18
|
+
default_executable: smagacor
|
19
|
+
bindir: bin
|
20
|
+
has_rdoc: true
|
21
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
22
|
+
requirements:
|
23
|
+
-
|
24
|
+
- ">"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.0
|
27
|
+
version:
|
28
|
+
platform: ruby
|
29
|
+
authors:
|
30
|
+
- Thomas Leitner
|
31
|
+
files:
|
32
|
+
- setup.rb
|
33
|
+
- install.rb
|
34
|
+
- TODO
|
35
|
+
- COPYING
|
36
|
+
- README
|
37
|
+
- Rakefile
|
38
|
+
- ChangeLog
|
39
|
+
- VERSION
|
40
|
+
- bin/smagacor
|
41
|
+
- lib/smagacor
|
42
|
+
- lib/smagacor/controller.rb
|
43
|
+
- lib/smagacor/smagacor-ui.rb
|
44
|
+
- test/games
|
45
|
+
- test/runtests.rb
|
46
|
+
- test/smagacor
|
47
|
+
- test/games/tictactoe
|
48
|
+
- test/games/tictactoe/game.info
|
49
|
+
- test/smagacor/tc_controller.rb
|
50
|
+
- data/smagacor
|
51
|
+
- data/smagacor/tictactoe
|
52
|
+
- data/smagacor/smagacor.png
|
53
|
+
- data/smagacor/tictactoe/o.png
|
54
|
+
- data/smagacor/tictactoe/x.png
|
55
|
+
- data/smagacor/tictactoe/tictactoe.rb
|
56
|
+
- data/smagacor/tictactoe/tictactoe.png
|
57
|
+
- data/smagacor/tictactoe/game.info
|
58
|
+
test_files: []
|
59
|
+
rdoc_options:
|
60
|
+
- "--line-numbers"
|
61
|
+
- "-m README"
|
62
|
+
extra_rdoc_files:
|
63
|
+
- README
|
64
|
+
- bin/smagacor
|
65
|
+
executables:
|
66
|
+
- smagacor
|
67
|
+
extensions: []
|
68
|
+
requirements: []
|
69
|
+
dependencies: []
|