Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alvagi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
alvagi
Commits
9a1cf963
Commit
9a1cf963
authored
Jun 11, 2015
by
antirek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix setVariable
parent
9d48a279
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
app.js
app.js
+10
-7
context.js
lib/context.js
+1
-1
index.js
test/index.js
+2
-2
No files found.
app.js
View file @
9a1cf963
var
AGIServer
=
require
(
'
./lib/index
'
);
var
handler
=
function
(
context
)
{
context
.
onEvent
(
'
variables
'
)
.
then
(
function
(
vars
)
{
return
context
.
streamFile
(
'
beep
'
);
})
.
then
(
function
(
result
)
{
return
context
.
end
();
});
context
.
onEvent
(
'
variables
'
)
.
then
(
function
(
vars
)
{
return
context
.
streamFile
(
'
beep
'
);
})
.
then
(
function
(
result
)
{
return
context
.
setVariable
(
'
RECOGNITION_RESULT
'
,
'
I
\'
m your father, Luc
'
);
})
.
then
(
function
(
result
)
{
return
context
.
end
();
});
};
var
agi
=
new
AGIServer
(
handler
);
...
...
lib/context.js
View file @
9a1cf963
...
...
@@ -225,7 +225,7 @@ Context.prototype.setMusic = function (musicclass) {
};
Context
.
prototype
.
setVariable
=
function
(
name
,
value
)
{
return
this
.
sendCommand
(
'
SET VARIABLE
'
+
name
+
'
'
+
value
);
return
this
.
sendCommand
(
'
SET VARIABLE
'
+
name
+
'
"
'
+
value
+
'
"
'
);
};
Context
.
prototype
.
sendImage
=
function
(
image
)
{
...
...
test/index.js
View file @
9a1cf963
...
...
@@ -235,8 +235,8 @@ describe('Context', function() {
describe
(
'
setVariable
'
,
function
()
{
it
(
'
sends correct command
'
,
function
()
{
this
.
context
.
setVariable
(
'
test
'
,
'
test
'
);
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
SET VARIABLE test
test
\n
'
);
this
.
context
.
setVariable
(
'
test
'
,
'
test
test test
'
);
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
SET VARIABLE test
"test test test"
\n
'
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment