     waitsForPromise ->
       atom.packages.activatePackage("language-powershell")
     this.addMatchers
-      toHaveScope: (scope) ->
-        notText = if @isNot then "not" else ""
-        this.message = =>"Expected token \"#{@actual.value}\" to #{notText} have scope \"#{scope}\". Instead found: [#{@actual.scopes.toString()}]"
-        return scope in @actual.scopes
-
       toHaveScopes: (scopes) ->
         notText = if @isNot then "not" else ""
-        this.message = =>"Expected token \"#{@actual.value}\" to #{notText} have scope \"#{scope}\". Instead found: [#{@actual.scopes.toString()}]"
+        this.message = =>"Expected token \"#{@actual.value}\" to #{notText} have scope \"#{scope.toString}\". Instead found: [#{@actual.scopes.toString()}]"
         allScopesPresent = scopes.every (scope) =>
           return scope in @actual.scopes
 

        for keyword in keywords
          {tokens} = grammar.tokenizeLine keyword
          expect(tokens[0].value).toEqual keyword
          expect(tokens[0]).toHaveScope "keyword.control.flow.powershell"

    describe "Flow keywords", ->
      describe "If-else statements", ->

        expect(tokens[0].value).toEqual "$"
        expect(tokens[0]).toHaveScopes ["variable.language.powershell", "punctuation.variable.begin.powershell"]
        expect(tokens[1].value).toEqual variable.substr(1)
        expect(tokens[1]).toHaveScopes ["variable.language.powershell"]
        expect(tokens[1]).not.toHaveScopes ["punctuation.variable.begin.powershell"]

  describe "Cmdlets", ->
    cmdlets = ["Get-ChildItem","_-_","underscores_are-not_a_problem"]
