One more use case for move_absolute

pull/305/head
Rick Carlino 2016-12-20 15:13:18 -06:00
parent 1d9b5c331e
commit 4f0cf24097
1 changed files with 25 additions and 0 deletions

View File

@ -73,6 +73,31 @@ describe CeleryScript::Corpus do
expect(check.error.message).to include("'location' within 'move_absolute'")
end
it "finds problems with nested nodes" do
bad = CeleryScript::AstNode.new({
kind: "move_absolute",
args: {
location: {
kind: "tool",
# Invalid:
args: { tool_id: "PROBLEM!" }
},
offset: {
kind: "coordinate",
args: {
"x": 0,
"y": 0,
"z": 0
}
},
speed: 100
}
})
check = CeleryScript::Checker.new(bad, Sequence::Corpus)
expect(check.valid?).to be_falsey
expect(check.error.message).to include("but got String")
end
it "serializes into JSON" do
result = JSON.parse(corpus.to_json)