PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/RubyPlugin/src/org/jedit/ruby/test/TestRDocSeacher.java

#
Java | 52 lines | 24 code | 6 blank | 22 comment | 0 complexity | 57c148f531107847677c6514ff5d466f MD5 | raw file
 1/*
 2 * TestRDocSeacher.java - 
 3 *
 4 * Copyright 2005 Robert McKinnon
 5 *
 6 * This program is free software; you can redistribute it and/or
 7 * modify it under the terms of the GNU General Public License
 8 * as published by the Free Software Foundation; either version 2
 9 * of the License, or any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 */
20package org.jedit.ruby.test;
21
22import org.jedit.ruby.ri.RDocSeacher;
23import org.jedit.ruby.ast.Member;
24
25import java.util.List;
26
27import junit.framework.TestCase;
28
29/**
30 * @author robmckinnon at users.sourceforge.net
31 */
32public final class TestRDocSeacher extends TestCase {
33
34    private static final String RESULT = "More than one method matched your request. You can refine\n" +
35            "your search by asking for information on one of:\n" +
36            "\n" +
37            "     Method#to_s, Vector#to_s, Struct#to_s, Time#to_s, CGI::Cookie#to_s,\n" +
38            "     Array#to_s, Matrix#to_s, MatchData#to_s, FalseClass#to_s,\n" +
39            "     Pathname#to_s, Hash#to_s, UnboundMethod#to_s, TrueClass#to_s,\n" +
40            "     Module#to_s, Complex#to_s, Proc#to_s, Symbol#to_s, Symbol#to_sym,\n" +
41            "     Exception#to_s, Bignum#to_s, Object#to_s, NilClass#to_s,\n" +
42            "     Range#to_s, Date#to_s, NameError#to_s, NameError::message#to_str,\n" +
43            "     Fixnum#to_s, Fixnum#to_sym, Float#to_s, String#to_s, String#to_str,\n" +
44            "     String#to_sym, Regexp#to_s, Benchmark::Tms#to_s,\n" +
45            "     Process::Status#to_s, Enumerable#to_set";
46
47    public final void testParseMultipleMatches() {
48        List<Member> methods = org.jedit.ruby.ri.RDocSeacher.parseMultipleResults(RESULT);
49        assertEquals("Assert first method correct: ", "Array#to_s", methods.get(0).getFullName());
50        assertEquals("Assert first method correct: ", "Vector#to_s", methods.get(35).getFullName());
51    }
52}