aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Blott2016-03-27 10:05:20 +0100
committerStephen Blott2016-03-27 10:05:20 +0100
commit0656f3ef0dd5f3cfa12f6c925298f30168b00e12 (patch)
tree001c1fe8866b0a1f3cedb0e4b7016d5d34e696a6 /tests
parentfa67b115ce1a20e64da5b8eaa67e2979fad8f89d (diff)
downloadvimium-0656f3ef0dd5f3cfa12f6c925298f30168b00e12.tar.bz2
Add test for invokeCommandString().
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/utils_test.coffee20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee
index 93849349..691b26ec 100644
--- a/tests/unit_tests/utils_test.coffee
+++ b/tests/unit_tests/utils_test.coffee
@@ -129,3 +129,23 @@ context "makeIdempotent",
context "distinctCharacters",
should "eliminate duplicate characters", ->
assert.equal "abc", Utils.distinctCharacters "bbabaabbacabbbab"
+
+context "invokeCommandString",
+ setup ->
+ @beenCalled = false
+ window.singleComponentCommand = => @beenCalled = true
+ window.twoComponentCommand = command: window.singleComponentCommand
+
+ tearDown ->
+ delete window.singleComponentCommand
+ delete window.twoComponentCommand
+
+ should "invoke single-component commands", ->
+ assert.isFalse @beenCalled
+ Utils.invokeCommandString "singleComponentCommand"
+ assert.isTrue @beenCalled
+
+ should "invoke multi-component commands", ->
+ assert.isFalse @beenCalled
+ Utils.invokeCommandString "twoComponentCommand.command"
+ assert.isTrue @beenCalled