Examples of IRubyParseResult


Examples of com.puppetlabs.geppetto.ruby.spi.IRubyParseResult

  public void testHelloBrokenWorld() throws Exception {
    File aRubyFile = TestDataProvider.getTestFile(new Path("testData/ruby/helloBrokenWorld.rb"));
    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      IRubyParseResult r = helper.parse(aRubyFile);
      assertEquals("Expect one error", 1, r.getIssues().size());
      IRubyIssue theIssue = r.getIssues().get(0);
      assertTrue("Expect one syntax error", theIssue.isSyntaxError());
      assertEquals("source line starts with 1", 1, theIssue.getLine());
      assertEquals("the file path is reported", aRubyFile.getPath(), theIssue.getFileName());
      assertTrue("the error message is the expected", theIssue.getMessage().contains("unexpected tLPAREN_ARG"));
      // assertTrue("the error message is the expected", theIssue.getMessage().startsWith("syntax error, unexpected tLPAREN_ARG"));
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.spi.IRubyParseResult

  public void testHelloBrokenWorld2() throws Exception {
    File aRubyFile = TestDataProvider.getTestFile(new Path("testData/ruby/helloBrokenWorld2.rb"));
    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      IRubyParseResult r = helper.parse(aRubyFile);
      assertEquals("Expect one error", 1, r.getIssues().size());
      IRubyIssue theIssue = r.getIssues().get(0);
      assertTrue("Expect one syntax error", theIssue.isSyntaxError());
      assertEquals("source line is 2", 2, theIssue.getLine());
      assertEquals("the file path is reported", aRubyFile.getPath(), theIssue.getFileName());
      assertTrue("the error message is the expected", theIssue.getMessage().contains("unexpected tLPAREN_ARG"));
    }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.spi.IRubyParseResult

  private void validateRubyFile(RubyHelper rubyHelper, Diagnostic diagnostics, File f, File root,
      IProgressMonitor monitor) {
    SubMonitor ticker = SubMonitor.convert(monitor, 1);
    try {
      IRubyParseResult result = rubyHelper.parse(f);
      for(IRubyIssue issue : result.getIssues()) {
        addRubyIssueDiagnostic(diagnostics, issue, f, root);
      }
    }
    catch(Exception e) {
      addExceptionDiagnostic(diagnostics, "Internal Error: Exception while processing file: " + f.toString(), e);
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.