@@ -9,30 +9,33 @@ import java.nio.file.Paths
9
9
10
10
class ShouldThrowIntentionTest : LightJavaCodeInsightFixtureTestCase () {
11
11
12
- override fun getTestDataPath (): String {
13
- val path = Paths .get(" ./src/test/resources/" ).toAbsolutePath()
14
- return path.toString()
15
- }
16
-
17
- fun testIntentionForPartialLine () {
18
-
19
- myFixture.configureByFiles(
20
- " /intentions/should_throw.kt" ,
21
- " /io/kotest/core/spec/style/specs.kt"
22
- )
23
- editor.moveCaret(649 )
24
- editor.selectionModel.setSelection(649 , 651 )
25
-
26
- val intention = myFixture.findSingleIntention(" Surround statements with shouldThrow assertion" )
27
- intention.familyName shouldBe " Surround statements with shouldThrow assertion"
28
-
29
- CommandProcessor .getInstance().runUndoTransparentAction {
30
- runWriteAction {
31
- intention.invoke(project, editor, file)
12
+ init {
13
+ testMode = true
14
+ }
15
+
16
+ override fun getTestDataPath (): String {
17
+ val path = Paths .get(" ./src/test/resources/" ).toAbsolutePath()
18
+ return path.toString()
19
+ }
20
+
21
+ fun testIntentionForPartialLine () {
22
+ myFixture.configureByFiles(
23
+ " /intentions/should_throw.kt" ,
24
+ " /io/kotest/core/spec/style/specs.kt"
25
+ )
26
+ editor.moveCaret(649 )
27
+ editor.selectionModel.setSelection(649 , 651 )
28
+
29
+ val intention = myFixture.findSingleIntention(" Surround statements with shouldThrow assertion" )
30
+ intention.familyName shouldBe " Surround statements with shouldThrow assertion"
31
+
32
+ CommandProcessor .getInstance().runUndoTransparentAction {
33
+ runWriteAction {
34
+ intention.invoke(project, editor, file)
35
+ }
32
36
}
33
- }
34
37
35
- file.text shouldBe """ package com.sksamuel.kotest.specs.behavior
38
+ file.text shouldBe """ package com.sksamuel.kotest.specs.behavior
36
39
37
40
import io.kotest.core.spec.style.BehaviorSpec
38
41
import io.kotest.matchers.string.shouldStartWith
@@ -65,28 +68,28 @@ class BehaviorSpecExample : BehaviorSpec() {
65
68
}
66
69
}
67
70
"""
68
- }
71
+ }
69
72
70
- fun testIntentionForFullSelection () {
73
+ fun testIntentionForFullSelection () {
71
74
72
- myFixture.configureByFiles(
73
- " /intentions/should_throw.kt" ,
74
- " /io/kotest/core/spec/style/specs.kt"
75
- )
75
+ myFixture.configureByFiles(
76
+ " /intentions/should_throw.kt" ,
77
+ " /io/kotest/core/spec/style/specs.kt"
78
+ )
76
79
77
- editor.moveCaret(631 )
78
- editor.selectionModel.setSelection(631 , 658 )
80
+ editor.moveCaret(631 )
81
+ editor.selectionModel.setSelection(631 , 658 )
79
82
80
- val intention = myFixture.findSingleIntention(" Surround statements with shouldThrow assertion" )
81
- intention.familyName shouldBe " Surround statements with shouldThrow assertion"
83
+ val intention = myFixture.findSingleIntention(" Surround statements with shouldThrow assertion" )
84
+ intention.familyName shouldBe " Surround statements with shouldThrow assertion"
82
85
83
- CommandProcessor .getInstance().runUndoTransparentAction {
84
- runWriteAction {
85
- intention.invoke(project, editor, file)
86
+ CommandProcessor .getInstance().runUndoTransparentAction {
87
+ runWriteAction {
88
+ intention.invoke(project, editor, file)
89
+ }
86
90
}
87
- }
88
91
89
- file.text shouldBe """ package com.sksamuel.kotest.specs.behavior
92
+ file.text shouldBe """ package com.sksamuel.kotest.specs.behavior
90
93
91
94
import io.kotest.core.spec.style.BehaviorSpec
92
95
import io.kotest.matchers.string.shouldStartWith
@@ -119,5 +122,5 @@ class BehaviorSpecExample : BehaviorSpec() {
119
122
}
120
123
}
121
124
"""
122
- }
125
+ }
123
126
}
0 commit comments