PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. */
  20. package org.jedit.ruby.test;
  21. import org.jedit.ruby.ri.RDocSeacher;
  22. import org.jedit.ruby.ast.Member;
  23. import java.util.List;
  24. import junit.framework.TestCase;
  25. /**
  26. * @author robmckinnon at users.sourceforge.net
  27. */
  28. public final class TestRDocSeacher extends TestCase {
  29. private static final String RESULT = "More than one method matched your request. You can refine\n" +
  30. "your search by asking for information on one of:\n" +
  31. "\n" +
  32. " Method#to_s, Vector#to_s, Struct#to_s, Time#to_s, CGI::Cookie#to_s,\n" +
  33. " Array#to_s, Matrix#to_s, MatchData#to_s, FalseClass#to_s,\n" +
  34. " Pathname#to_s, Hash#to_s, UnboundMethod#to_s, TrueClass#to_s,\n" +
  35. " Module#to_s, Complex#to_s, Proc#to_s, Symbol#to_s, Symbol#to_sym,\n" +
  36. " Exception#to_s, Bignum#to_s, Object#to_s, NilClass#to_s,\n" +
  37. " Range#to_s, Date#to_s, NameError#to_s, NameError::message#to_str,\n" +
  38. " Fixnum#to_s, Fixnum#to_sym, Float#to_s, String#to_s, String#to_str,\n" +
  39. " String#to_sym, Regexp#to_s, Benchmark::Tms#to_s,\n" +
  40. " Process::Status#to_s, Enumerable#to_set";
  41. public final void testParseMultipleMatches() {
  42. List<Member> methods = org.jedit.ruby.ri.RDocSeacher.parseMultipleResults(RESULT);
  43. assertEquals("Assert first method correct: ", "Array#to_s", methods.get(0).getFullName());
  44. assertEquals("Assert first method correct: ", "Vector#to_s", methods.get(35).getFullName());
  45. }
  46. }