|
From: <caw...@us...> - 2006-08-19 23:56:30
|
Revision: 1573 Author: cawilliams Date: 2006-08-19 16:56:24 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1573&view=rev Log Message: ----------- Modified Paths: -------------- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java =================================================================== --- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java 2006-08-19 23:56:16 UTC (rev 1572) +++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyLintVisitor.java 2006-08-19 23:56:24 UTC (rev 1573) @@ -37,14 +37,26 @@ } } - public void testBlah() throws Exception { - String contents = "@var = 3 unless @blah"; + private MockProblemRequestor problemRequestor; + + public void testUnlessModififerDoesntCreateEmptyConditionalWarning() throws Exception { + runLint("@var = 3 unless @blah"); + assertEquals(0, problemRequestor.problems.size()); + } + + + public void testUnlessConditionalDoesntCreateEmptyConditionalWarning() throws Exception { + runLint("unless @blah\n @var = 3\nend"); + System.out.println(problemRequestor.problems.get(0)); + assertEquals(0, problemRequestor.problems.size()); + } + + private void runLint(String contents) { RubyParser parser = new RubyParser(); Node rootNode = parser.parse(new ShamFile("fake/path.rb"), new StringReader(contents)); - MockProblemRequestor problemRequestor = new MockProblemRequestor(); + problemRequestor = new MockProblemRequestor(); RubyLintVisitor visitor = new RubyLintVisitor(contents, problemRequestor); rootNode.accept(visitor); - assertEquals(1, problemRequestor.problems.size()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |