assets/vendor/screw-unit/EXAMPLE.html in screw_server-0.1.7 vs assets/vendor/screw-unit/EXAMPLE.html in screw_server-0.1.8
- old
+ new
@@ -17,19 +17,19 @@
<script src="lib/screw.builder.js"></script>
<script src="lib/screw.matchers.js"></script>
<script src="lib/screw.events.js"></script>
<script src="lib/screw.behaviors.js"></script>
<link rel="stylesheet" href="lib/screw.css">
-
+
<script type="text/javascript">
// Here is the system under test (SUT)--that is, your application code that you would like
// to test.
function foo() {
return 2;
}
</script>
-
+
<script type="text/javascript">
// Here is a Custom Matcher. A custom matcher is a custom assertion,
// tailored to your application; these help to make your tests more readable.
Screw.Matchers["be_even"] = {
match: function(expected, actual) {
@@ -38,11 +38,11 @@
failure_message: function(expected, actual, not) {
return 'expected ' + $.print(actual) + (not ? ' not' : '') + ' to be even';
}
}
</script>
-
+
<script type="text/javascript">
// Here is a sample test. Note that all tests are wrapped in
// "Screw.Unit(function() { ... })".
Screw.Unit(function() {
// Tests are organized into 'describes' and 'its', following the style of RSpec.
@@ -51,10 +51,10 @@
// 'equal' is one among many matchers provided with the Screw.Unit distribution. It
// is smart enough to compare arrays, objects, and primitives.
expect(foo()).to(equal, 2);
});
});
-
+
describe("numbers", function() {
// Here is a use of the custom matcher defined above.
it("either is or is not even", function() {
expect(2).to(be_even);
expect(3).to_not(be_even);
\ No newline at end of file