Examples of RbVariableInjector


Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

public class RbVariableInjectorTest extends CommandLineTestCase {

  @Test
  public void construction_nullMethod() throws Exception {
    try{
      new RbVariableInjector("", null);
      fail("why construct w/ null method?");
    }catch(IllegalArgumentException t){
      // this is ok - we want this!
    }
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

  }
 
  @Test
  public void injectInputVariables_filePath() throws Exception {
    String lesson = "meh ${file_path}";
    String result = new RbVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    String firstPkgName = "com";
    // just inspect anything beyond the root of the project
    result = result.substring(result.indexOf(firstPkgName)+firstPkgName.length(), result.length());
    assertTrue(result.indexOf(firstPkgName) < result.indexOf("sandwich"));
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

  }
 
  @Test
  public void injectInputVariables_fileName() throws Exception {
    String lesson = "meh ${file_name}";
    String result = new RbVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    assertEquals("meh OneFailingKoan", result);
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

  }
 
  @Test
  public void injectInputVariables_methodName() throws Exception {
    String lesson = "meh ${method_name}";
    String result = new RbVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    assertEquals("meh koanMethod", result);
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

  }
 
  @Test
  public void nothingToInject() throws Exception {
    String lesson = " meh ea asdwdw s ";
    assertSame(lesson, new RbVariableInjector(lesson,
      OneFailingKoan.class.getDeclaredMethod("koanMethod")).injectLessonVariables());
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.RbVariableInjector

  private KoanMethod(String lesson, Method method, boolean displayIncompleteException){
    if(method == null){
      throw new IllegalArgumentException("method may not be null");
    }
    this.method = method;
    this.lesson = new RbVariableInjector(lesson, method).injectLessonVariables();
    this.displayIncompleteException = displayIncompleteException;
  }
View Full Code Here
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.