package com.karateca.ddescriber;

import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.editor.impl.DocumentImpl;
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import junit.framework.Assert;

import java.io.File;

/**
 * @author Andres Dominguez.
 */
public class BaseTestCase extends LightCodeInsightFixtureTestCase {

  DocumentImpl document;
  JasmineFinder jasmineFinder;

  @Override
  protected String getTestDataPath() {
    String testPath = PathManager.getJarPathForClass(BaseTestCase.class);
    File sourceRoot = new File(testPath, "../../..");
    return new File(sourceRoot, "testData").getPath();
  }

  public void testDummyTest() {
    // Created this test to get rid of the warning.
    Assert.assertEquals(1, 1);
  }

  void prepareScenarioWithTestFile(String fileName) {
    PsiFile psiFile = myFixture.configureByFile(fileName);
    document = new DocumentImpl(psiFile.getText());
    jasmineFinder = new JasmineFinder(getProject(), document);
  }
}

@@ -119,21 +119,16 @@
 tor.
-impl.
 Document
 Impl
@@ -123,20 +123,16 @@
 Document
-Impl
 ;%0Aimport
@@ -404,20 +404,16 @@
 Document
-Impl
  documen
@@ -938,20 +938,30 @@
 t = 
-new 
+ActionUtil.get
 Document
 Impl
@@ -960,12 +960,8 @@
 ment
-Impl
 (psi
@@ -972,12 +972,19 @@
 .get
-Text
+VirtualFile
 ());

use action util to get doc