Package com.github.mustachejava

Source Code of com.github.mustachejava.IndySpecTest

package com.github.mustachejava;

import com.github.mustachejava.codegen.CodegenMustacheFactory;
import com.github.mustachejava.indy.IndyObjectHandler;
import org.codehaus.jackson.JsonNode;

import java.io.Reader;
import java.io.StringReader;

/**
* Specification tests
*/
public class IndySpecTest extends SpecTest {
  @Override
  protected DefaultMustacheFactory createMustacheFactory(final JsonNode test) {
    DefaultMustacheFactory mustacheFactory = new CodegenMustacheFactory("/spec/specs") {
      @Override
      public Reader getReader(String resourceName) {
        JsonNode partial = test.get("partials").get(resourceName);
        return new StringReader(partial == null ? "" : partial.getTextValue());
      }
    };
    mustacheFactory.setObjectHandler(new IndyObjectHandler());
    return mustacheFactory;
  }
}
TOP

Related Classes of com.github.mustachejava.IndySpecTest

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.