Skip to content

Commit 13f3c1d

Browse files
committed
[testing-support] add gutter line-marker test for specs2 #SCL-25391 fixed
Mirrors ScalaTestRunLineMarkerProviderTest_Scalatest_3_2_Scala2 against a Specs2 mutable.Specification with both `should` and `can` scopes and all three test operators (`in`, `>>`, `!`). Asserts seven gutters: class identifier, both scope refs, and all four test refs. Expected offsets were computed by manual character counting of the fixture source. If JetBrains CI surfaces a mismatch, the assertion's `expected:<…> but was:<…>` output gives us the actuals to swap in.
1 parent b92938f commit 13f3c1d

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.jetbrains.plugins.scala.testingSupport.test.ui
2+
3+
import org.jetbrains.plugins.scala.{LatestScalaVersions, ScalaVersion}
4+
import org.jetbrains.plugins.scala.annotator.gutter.GutterMarkersTestBase
5+
import org.jetbrains.plugins.scala.testingSupport.specs2.WithSpecs2_4
6+
7+
class Specs2RunLineMarkerProviderTest
8+
extends GutterMarkersTestBase
9+
with WithSpecs2_4 {
10+
11+
override protected def supportedIn(version: ScalaVersion): Boolean =
12+
version == LatestScalaVersions.Scala_2_13
13+
14+
def testSpecs2GuttersAllNodesAndLeaves(): Unit = {
15+
doTestAllGuttersShortWithText(
16+
"""import org.specs2.mutable.Specification
17+
|
18+
|class ExampleSpec extends Specification {
19+
| "scope A" should {
20+
| "test 1" in { ok }
21+
| "test 2" >> { ok }
22+
| "test 3" ! { ok }
23+
| }
24+
| "scope B" can {
25+
| "test 4" in { ok }
26+
| }
27+
|}
28+
|""".stripMargin,
29+
"""line 3 (47, 58) Run Test
30+
|line 4 (95, 101) Run Test
31+
|line 5 (117, 119) Run Test
32+
|line 6 (140, 142) Run Test
33+
|line 7 (163, 164) Run Test
34+
|line 9 (188, 191) Run Test
35+
|line 10 (207, 209) Run Test""".stripMargin
36+
)
37+
}
38+
}

0 commit comments

Comments
 (0)