forked from borisbrodski/Jnario
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue sebastianbenz#171 Full qualified names in "should be"
the JnarioCompiler no longer considers packageFragments as fully-fledged sub-expressions
- Loading branch information
Showing
6 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...o.tests/doc-gen/org/jnario/spec/tests/unit/compiler/QualfiedReferencesInShouldBeSpec.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Qualfied References in should be</title> | ||
<meta name="description" content=""> | ||
<meta name="author" content="Jnario"> | ||
|
||
<!--[if lt IE 9]> | ||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
|
||
<link rel="stylesheet" href="../../../../../../css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="../../../../../../css/bootstrap-responsive.min.css"> | ||
<link rel="stylesheet" href="../../../../../../css/custom.css"> | ||
<link rel="stylesheet" href="../../../../../../css/prettify.css"> | ||
<script type="text/javascript" src="../../../../../../js/prettify.js"></script> | ||
<script type="text/javascript" src="../../../../../../js/lang-jnario.js"></script> | ||
<script type="text/javascript" src="../../../../../../js/jquery.js"></script> | ||
<script type="text/javascript" src="../../../../../../js/bootstrap-tab.js"></script> | ||
</head> | ||
|
||
<body onload="prettyPrint()"> | ||
<div class="container"> | ||
<div class="tabbable"> | ||
<div class="content"> | ||
<div class="page-header pending"> | ||
<h1>Qualfied References in should be</h1> | ||
<ul class="nav nav-tabs pull-right"> | ||
<li class="active"><a href="#spec" data-toggle="tab">Spec</a></li> | ||
<li><a href="#source" data-toggle="tab">Source</a></li> | ||
</ul> | ||
</div> | ||
<div class="row"> | ||
<div class="span12"> | ||
<div class="tab-content"> | ||
<div class="tab-pane active" id="spec"> | ||
<ul><li><p id="it_should_successfully_generate_asserts_on_QualifiedRefernces" class="example notrun"><strong>it should successfully generate asserts on QualifiedRefernces</strong></p> | ||
<pre class="prettyprint lang-spec linenums"> | ||
java.lang.System => java.lang.System | ||
java.lang.System should be java.lang.System | ||
|
||
java.lang.System should not be java.lang.String</pre> | ||
</li><li><p id="it_should_successfully_generate_asserts_on_members_of_QualifiedRefernces" class="example notrun"><strong>it should successfully generate asserts on members of QualifiedRefernces</strong></p> | ||
<pre class="prettyprint lang-spec linenums"> | ||
java.lang.System.classLoader => java.lang.System.classLoader | ||
java.lang.System.classLoader should be java.lang.System.classLoader | ||
|
||
java.lang.String.canonicalName should not be java.lang.Integer.canonicalName</pre> | ||
</li></ul> | ||
</div> | ||
<div class="tab-pane" id="source"> | ||
<h3>QualifiedReferencesInsideShouldBe.spec</h3> | ||
<p> | ||
<pre class="prettyprint lang-spec linenums"> | ||
package org.jnario.spec.tests.unit.compiler | ||
|
||
describe "Qualfied References in should be"{ | ||
|
||
fact "it should successfully generate asserts on QualifiedRefernces"{ | ||
java.lang.System => java.lang.System | ||
java.lang.System should be java.lang.System | ||
|
||
java.lang.System should not be java.lang.String | ||
} | ||
|
||
fact "it should successfully generate asserts on members of QualifiedRefernces"{ | ||
java.lang.System.classLoader => java.lang.System.classLoader | ||
java.lang.System.classLoader should be java.lang.System.classLoader | ||
|
||
java.lang.String.canonicalName should not be java.lang.Integer.canonicalName | ||
} | ||
|
||
} | ||
</pre> | ||
</p></div> | ||
</div> | ||
</div> | ||
</div> <!-- /row --> | ||
</div> <!-- /content --> | ||
</div> <!-- /tabbable --> | ||
<footer> | ||
<p><small>Generated by <a href="http://www.jnario.org">Jnario</a>.</small></p> | ||
</footer> | ||
</div> <!-- /container --> | ||
|
||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...ario.tests/src/org/jnario/spec/tests/unit/compiler/QualifiedReferencesInsideShouldBe.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jnario.spec.tests.unit.compiler | ||
|
||
describe "Qualfied References in should be"{ | ||
|
||
fact "it should successfully generate asserts on QualifiedRefernces"{ | ||
java.lang.System => java.lang.System | ||
java.lang.System should be java.lang.System | ||
|
||
java.lang.System should not be java.lang.String | ||
} | ||
|
||
fact "it should successfully generate asserts on members of QualifiedRefernces"{ | ||
java.lang.System.classLoader => java.lang.System.classLoader | ||
java.lang.System.classLoader should be java.lang.System.classLoader | ||
|
||
java.lang.String.canonicalName should not be java.lang.Integer.canonicalName | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...tests/xtend-gen/org/jnario/spec/tests/unit/compiler/QualfiedReferencesInShouldBeSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.jnario.spec.tests.unit.compiler; | ||
|
||
import org.jnario.lib.Assert; | ||
import org.jnario.lib.Should; | ||
import org.jnario.runner.ExampleGroupRunner; | ||
import org.jnario.runner.Named; | ||
import org.jnario.runner.Order; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@Named("Qualfied References in should be") | ||
@RunWith(ExampleGroupRunner.class) | ||
@SuppressWarnings("all") | ||
public class QualfiedReferencesInShouldBeSpec { | ||
@Test | ||
@Named("it should successfully generate asserts on QualifiedRefernces") | ||
@Order(1) | ||
public void _itShouldSuccessfullyGenerateAssertsOnQualifiedRefernces() throws Exception { | ||
boolean _doubleArrow = Should.operator_doubleArrow( | ||
System.class, System.class); | ||
Assert.assertTrue("\nExpected java.lang.System => java.lang.System but" | ||
+ "\n java.lang.System is " + new org.hamcrest.StringDescription().appendValue(System.class).toString() + "\n", _doubleArrow); | ||
|
||
boolean _should_be = Should.should_be( | ||
System.class, System.class); | ||
Assert.assertTrue("\nExpected java.lang.System should be java.lang.System but" | ||
+ "\n java.lang.System is " + new org.hamcrest.StringDescription().appendValue(System.class).toString() + "\n", _should_be); | ||
|
||
Assert.assertFalse("\nExpected java.lang.System should not be java.lang.String but" | ||
+ "\n java.lang.System is " + new org.hamcrest.StringDescription().appendValue(System.class).toString() | ||
+ "\n java.lang.String is " + new org.hamcrest.StringDescription().appendValue(String.class).toString() + "\n", Should.should_be( | ||
System.class, String.class)); | ||
|
||
} | ||
|
||
@Test | ||
@Named("it should successfully generate asserts on members of QualifiedRefernces") | ||
@Order(2) | ||
public void _itShouldSuccessfullyGenerateAssertsOnMembersOfQualifiedRefernces() throws Exception { | ||
ClassLoader _classLoader = System.class.getClassLoader(); | ||
ClassLoader _classLoader_1 = System.class.getClassLoader(); | ||
boolean _doubleArrow = Should.<ClassLoader>operator_doubleArrow(_classLoader, _classLoader_1); | ||
Assert.assertTrue("\nExpected java.lang.System.classLoader => java.lang.System.classLoader but" | ||
+ "\n java.lang.System.classLoader is " + new org.hamcrest.StringDescription().appendValue(_classLoader).toString() | ||
+ "\n java.lang.System is " + new org.hamcrest.StringDescription().appendValue(System.class).toString() + "\n", _doubleArrow); | ||
|
||
ClassLoader _classLoader_2 = System.class.getClassLoader(); | ||
ClassLoader _classLoader_3 = System.class.getClassLoader(); | ||
boolean _should_be = Should.<ClassLoader>should_be(_classLoader_2, _classLoader_3); | ||
Assert.assertTrue("\nExpected java.lang.System.classLoader should be java.lang.System.classLoader but" | ||
+ "\n java.lang.System.classLoader is " + new org.hamcrest.StringDescription().appendValue(_classLoader_2).toString() | ||
+ "\n java.lang.System is " + new org.hamcrest.StringDescription().appendValue(System.class).toString() + "\n", _should_be); | ||
|
||
String _canonicalName = String.class.getCanonicalName(); | ||
String _canonicalName_1 = Integer.class.getCanonicalName(); | ||
Assert.assertFalse("\nExpected java.lang.String.canonicalName should not be java.lang.Integer.canonicalName but" | ||
+ "\n java.lang.String.canonicalName is " + new org.hamcrest.StringDescription().appendValue(_canonicalName).toString() | ||
+ "\n java.lang.String is " + new org.hamcrest.StringDescription().appendValue(String.class).toString() | ||
+ "\n java.lang.Integer.canonicalName is " + new org.hamcrest.StringDescription().appendValue(_canonicalName_1).toString() | ||
+ "\n java.lang.Integer is " + new org.hamcrest.StringDescription().appendValue(Integer.class).toString() + "\n", Should.<String>should_be(_canonicalName, _canonicalName_1)); | ||
|
||
} | ||
} |