summaryrefslogtreecommitdiffhomepage
path: root/samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-12-16 19:22:26 -0500
committerGitHub <[email protected]>2021-12-16 19:22:26 -0500
commit5954b9beb4d4a3b4f248d72d1851195f030558a8 (patch)
treefecd8aa840a25afdb502915b0fdb4d03b7ed339a /samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
parent2f845281f133849256b57bb08fd3e9ae57600784 (diff)
parenteaa29e72939f5edf61735ccbb73c36ee89369f65 (diff)
downloaddragonruby-game-toolkit-contrib-master.tar.gz
dragonruby-game-toolkit-contrib-master.zip
Merge branch 'DragonRuby:master' into masterHEADmaster
Diffstat (limited to 'samples/99_genre_crafting/farming_game_starting_point/app/tests.rb')
-rw-r--r--samples/99_genre_crafting/farming_game_starting_point/app/tests.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/samples/99_genre_crafting/farming_game_starting_point/app/tests.rb b/samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
new file mode 100644
index 0000000..458bc18
--- /dev/null
+++ b/samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
@@ -0,0 +1,29 @@
+# For advanced users:
+# You can put some quick verification tests here, any method
+# that starts with the `test_` will be run when you save this file.
+
+# Here is an example test and game
+
+# To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick
+
+class MySuperHappyFunGame
+ attr_gtk
+
+ def tick
+ outputs.solids << [100, 100, 300, 300]
+ end
+end
+
+def test_universe args, assert
+ game = MySuperHappyFunGame.new
+ game.args = args
+ game.tick
+ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"
+ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"
+ puts "test_universe completed successfully"
+end
+
+puts "running tests"
+$gtk.reset 100
+$gtk.log_level = :off
+$gtk.tests.start