Package hudson.plugins.rubyMetrics.railsStats

Source Code of hudson.plugins.rubyMetrics.railsStats.RailsStatsParserTest

package hudson.plugins.rubyMetrics.railsStats;

import hudson.plugins.rubyMetrics.railsStats.model.RailsStatsResults;
import junit.framework.TestCase;

public class RailsStatsParserTest extends TestCase {

    public void testParse() throws Exception {
        RailsStatsParser parser = new RailsStatsParser();

        String out =     "+----------------------+-------+-------+---------+---------+-----+-------+\n" +
                        "| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |\n" +
                        "+----------------------+-------+-------+---------+---------+-----+-------+\n" +
                        "| Controllers          |    15 |     4 |       1 |       0 |   0 |        0 |\n" +
                        "| Helpers              |     3 |     2 |       0 |       0 |   0 |     0 |\n" +
                        "| Models               |     0 |     0 |       0 |       0 |   0 |     0 |\n" +
                        "| Libraries            |     0 |     0 |       0 |       0 |   0 |     0 |\n" +
                        "| Integration tests    |     0 |     0 |       0 |       0 |   0 |     0 |\n" +
                        "| Functional tests     |     0 |     0 |       0 |       0 |   0 |     0 |\n" +
                        "| Unit tests           |     0 |     0 |       0 |       0 |   0 |     0 |\n" +
                        "+----------------------+-------+-------+---------+---------+-----+-------+\n" +
                        "| Total                |    18 |     6 |       1 |       0 |   0 |     0 |\n" +
                        "+----------------------+-------+-------+---------+---------+-----+-------+\n" +
                        "Code LOC: 6     Test LOC: 0     Code to Test Ratio: 1:0.0";

        RailsStatsResults metrics = parser.parse(out);

        assertTrue(!metrics.getMetrics().isEmpty());
        assertNotNull(metrics.getCodeLocSummary());
        assertNotNull(metrics.getTestLocSummary());
        assertNotNull(metrics.getCodeToTestRatio());
    }
}
TOP

Related Classes of hudson.plugins.rubyMetrics.railsStats.RailsStatsParserTest

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.