mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add isEqualTo(file: File)
This commit is contained in:
+4
@@ -24,6 +24,7 @@ import com.intellij.util.loadElement
|
||||
import org.assertj.core.api.AbstractAssert
|
||||
import org.assertj.core.internal.Objects
|
||||
import org.jdom.Element
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
|
||||
class JdomAssert(actual: Element?) : AbstractAssert<JdomAssert, Element?>(actual, JdomAssert::class.java) {
|
||||
@@ -37,6 +38,9 @@ class JdomAssert(actual: Element?) : AbstractAssert<JdomAssert, Element?>(actual
|
||||
return this
|
||||
}
|
||||
|
||||
@Deprecated("isEqualTo(file: Path)", ReplaceWith("isEqualTo(file.toPath())"))
|
||||
fun isEqualTo(file: File) = isEqualTo(file.toPath())
|
||||
|
||||
fun isEqualTo(file: Path): JdomAssert {
|
||||
isNotNull
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.intellij.testFramework.assertions.Assertions.assertThat;
|
||||
|
||||
@@ -97,7 +98,7 @@ public class EclipseImlTest extends IdeaTestCase {
|
||||
PathMacroManager.getInstance(project).collapsePaths(actualImlElement);
|
||||
PathMacros.getInstance().removeMacro(JUNIT);
|
||||
|
||||
assertThat(actualImlElement).isEqualTo(new File(project.getBaseDir().getPath() + "/expected", "expected.iml"));
|
||||
assertThat(actualImlElement).isEqualTo(Paths.get(project.getBaseDir().getPath(), "expected", "expected.iml"));
|
||||
}
|
||||
|
||||
public void testWorkspaceOnly() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user