Skip to content

Commit

Permalink
#10 one test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 1, 2021
1 parent 0026684 commit b5c57d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ SOFTWARE.
<groupId>com.jcabi</groupId>
<artifactId>jcabi-log</artifactId>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-matchers</artifactId>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-xml</artifactId>
Expand Down
13 changes: 8 additions & 5 deletions src/test/java/org/polystat/far/CalcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package org.polystat.far;

import com.jcabi.log.Logger;
import com.jcabi.matchers.XhtmlMatchers;
import com.jcabi.xml.XSL;
import org.cactoos.io.ResourceOf;
import org.cactoos.text.TextOf;
Expand All @@ -41,12 +42,14 @@ public final class CalcTest {

@Test
public void buildsSimpleRulesXsl() {
final Calc rules = new Calc("add(y) -> {{y 0}}");
final XSL xsl = rules.xsl();
Logger.debug(this, "calc.xsl:%n%s", xsl.toString());
MatcherAssert.assertThat(
rules.xsl(),
Matchers.notNullValue()
XhtmlMatchers.xhtml(new Calc("add(y) -> {{y 0}}").xsl()),
Matchers.allOf(
XhtmlMatchers.hasXPath("//xsl:stylesheet"),
XhtmlMatchers.hasXPath("//xsl:function[@name='ps:calc']"),
XhtmlMatchers.hasXPath("//xsl:when[@test=\"$y = '\\any'\"]"),
XhtmlMatchers.hasXPath("//xsl:when[@test=\"$func = 'add'\"]")
)
);
}

Expand Down

0 comments on commit b5c57d3

Please sign in to comment.