scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metals does not currently support the "behavior of" syntax of ScalaTest's FlatSpec style

piter75 opened this issue · comments

Describe the bug

Given the following test definition I would expect Metals to find proper test names:

package org.scalatest.examples.flatspec

import org.scalatest.flatspec.AnyFlatSpec

class SetSpec extends AnyFlatSpec {

  behavior of "An empty Set"

  it should "have size 0" in {
    assert(Set.empty.size === 0)
  }

  it should "produce NoSuchElementException when head is invoked" in {
    assertThrows[NoSuchElementException] {
      Set.empty.head
    }
  }
}

At this point however it does not recognise the "behavior of" syntax as the way to set test case name prefix.

Expected behavior

Metals should find two test cases:

"An empty Set should have size 0"
"An empty Set should produce NoSuchElementException when head is invoked" 

Operating system

None

Editor/Extension

VS Code

Version of Metals

v1.2.2

Extra context or search terms

https://www.scalatest.org/scaladoc/3.2.18/org/scalatest/flatspec/AnyFlatSpec.html