Examples of IRubyIssue


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

    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"));
    }
    finally {
      helper.tearDown();
    }
View Full Code Here

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

    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"));
    }
    finally {
      helper.tearDown();
    }
  }
View Full Code Here

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

        filename = "unknown";
        line = -1;
        message = "Can't find an error message to display!";
      }
      if (issues.size() == 1) {
        IRubyIssue issue = issues.get(0);
        filename = issue.getFileName();
        line = -1;
        message = issue.getMessage();
      } else {
        IRubyIssue issue = issues.get(0);
        filename = issue.getFileName();
        line = -1;
        message = "Several non syntax errors - file is the first reported file.";
      }
    }
  }
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.