aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Blott2016-02-16 14:12:16 +0000
committerStephen Blott2016-02-16 14:12:16 +0000
commit8e3ac1867b7577814865bf1cb40d0b865de30b1a (patch)
tree53279879b1549a597b71de93530d0feb8ab6f044 /tests
parentceada9cdf8cb97c35b4871553e3c8b642c4806ef (diff)
parent56fed2ac6663d99ca03023f3ffa313c51de5fe32 (diff)
downloadvimium-8e3ac1867b7577814865bf1cb40d0b865de30b1a.tar.bz2
Merge pull request #1994 from mrmr1993/correct-loop-types-2
Use `for own ... of` instead of `for ... of`
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/commands_test.coffee10
-rw-r--r--tests/unit_tests/test_helper.coffee2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee
index e55dc0f2..45cb4cf4 100644
--- a/tests/unit_tests/commands_test.coffee
+++ b/tests/unit_tests/commands_test.coffee
@@ -15,15 +15,15 @@ context "Validate commands and options",
should "have either noRepeat or repeatLimit, but not both", ->
# TODO(smblott) For this and each following test, is there a way to structure the tests such that the name
# of the offending command appears in the output, if the test fails?
- for command, options of Commands.availableCommands
+ for own command, options of Commands.availableCommands
assert.isTrue not (options.noRepeat and options.repeatLimit)
should "describe each command", ->
- for command, options of Commands.availableCommands
+ for own command, options of Commands.availableCommands
assert.equal 'string', typeof options.description
should "define each command in each command group", ->
- for group, commands of Commands.commandGroups
+ for own group, commands of Commands.commandGroups
for command in commands
assert.equal 'string', typeof command
assert.isTrue Commands.availableCommands[command]
@@ -36,13 +36,13 @@ context "Validate commands and options",
should "have valid commands for each default key mapping", ->
count = Object.keys(Commands.keyToCommandRegistry).length
assert.isTrue (0 < count)
- for key, command of Commands.keyToCommandRegistry
+ for own key, command of Commands.keyToCommandRegistry
assert.equal 'object', typeof command
assert.isTrue Commands.availableCommands[command.command]
context "Validate advanced commands",
setup ->
- @allCommands = [].concat.apply [], (commands for group, commands of Commands.commandGroups)
+ @allCommands = [].concat.apply [], (commands for own group, commands of Commands.commandGroups)
should "include each advanced command in a command group", ->
for command in Commands.advancedCommands
diff --git a/tests/unit_tests/test_helper.coffee b/tests/unit_tests/test_helper.coffee
index bb73bf54..ae2266cf 100644
--- a/tests/unit_tests/test_helper.coffee
+++ b/tests/unit_tests/test_helper.coffee
@@ -1,5 +1,5 @@
require("../shoulda.js/shoulda.js")
global.extend = (hash1, hash2) ->
- for key of hash2
+ for own key of hash2
hash1[key] = hash2[key]
hash1