Package org.jetbrains.plugins.cucumber.refactoring.rename

Source Code of org.jetbrains.plugins.cucumber.refactoring.rename.GherkinInplaceRenameTest

package org.jetbrains.plugins.cucumber.refactoring.rename;

import com.intellij.refactoring.RefactoringSettings;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
import org.jetbrains.plugins.cucumber.CucumberTestUtil;
import org.jetbrains.plugins.cucumber.psi.refactoring.rename.GherkinInplaceRenameHandler;

/**
* User: Andrey.Vokin
* Date: 10/8/13
*/
public class GherkinInplaceRenameTest extends LightPlatformCodeInsightFixtureTestCase {
  private static final String TEST_DATA_PATH = "/refactoring/rename";

  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
  public GherkinInplaceRenameTest() {
    PlatformTestCase.autodetectPlatformPrefix();
  }

  public void testRenameStepParameter() {
    doTest("newDescription");
  }

  private void doTest(String newName) {
    boolean b = RefactoringSettings.getInstance().RENAME_SEARCH_IN_COMMENTS_FOR_FILE;
    try {
      myFixture.configureByFile(getTestName(true) + ".feature");
      CodeInsightTestUtil.doInlineRename(new GherkinInplaceRenameHandler(), newName, myFixture);
      myFixture.checkResultByFile(getTestName(true) + "_after.feature");
    }
    finally {
      RefactoringSettings.getInstance().RENAME_SEARCH_IN_COMMENTS_FOR_FILE = b;
    }
  }

  @Override
  protected String getTestDataPath() {
    return CucumberTestUtil.getTestDataPath() + TEST_DATA_PATH;
  }
}
TOP

Related Classes of org.jetbrains.plugins.cucumber.refactoring.rename.GherkinInplaceRenameTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.