mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-06-26 03:50:49 +03:00
Fixed taking units, qUnit tests
This commit is contained in:
parent
8c9eeef6bd
commit
748b9c0e4d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salet",
|
||||
"version": "1.6.2",
|
||||
"version": "1.6.3",
|
||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||
"homepage": "http://salet.oreolek.ru",
|
||||
|
|
|
@ -2,7 +2,7 @@ class SaletRoom
|
|||
constructor: (spec) ->
|
||||
@visited = 0
|
||||
@title = "Room"
|
||||
@units = {}
|
||||
@units = []
|
||||
@canView = true
|
||||
@canChoose = true
|
||||
@priority = 1
|
||||
|
|
|
@ -50,7 +50,7 @@ $(document).ready(function() {
|
|||
});
|
||||
salet.rooms["start2"].take(lamp);
|
||||
assert.equal(lamp.location, "start2", "The lamp unit is in 'start2' room");
|
||||
salet.rooms["start2"].drop("");
|
||||
salet.rooms["start2"].drop("lamp");
|
||||
assert.equal(lamp.location, undefined, "The lamp unit is nowhere");
|
||||
});
|
||||
QUnit.test("Localization", function(assert) {
|
||||
|
@ -63,7 +63,7 @@ $(document).ready(function() {
|
|||
QUnit.test("View", function(assert) {
|
||||
salet.view.clearContent();
|
||||
assert.equal(jQuery("#content").html(), "", "View clears the content");
|
||||
salet.view.write("<p>hello</p>");
|
||||
salet.view.append("<p>hello</p>");
|
||||
return assert.equal(jQuery("#content").html(), "<p>hello</p>", "View writes new content");
|
||||
});
|
||||
return setTimeout(function() {
|
||||
|
|
Loading…
Reference in a new issue