Skip to content

Commit

Permalink
Documentation polish
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Jan 19, 2016
1 parent 36b4215 commit ec2af7e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Let's imagine we wanted to sort arrays of numbers using this function:

```js
function sort(arr) {
return [].concat(arr).sort();
return [].concat(arr).sort();
}
```

Expand All @@ -45,11 +45,11 @@ var g = require('chance-generators')(42);
var arrays = g.n(g.integer({ min: -20, max: 20 }), g.integer({ min: 1, max: 20 }));

expect(function (arr) {
var sorted = sort(arr);
var sorted = sort(arr);

expect(sorted, 'to have length', arr.length)
.and('first item to be less than or equal to all', arr)
.and('last item to be greater than or equal to all', arr);
expect(sorted, 'to have length', arr.length)
.and('first item to be less than or equal to all', arr)
.and('last item to be greater than or equal to all', arr);
}, 'to be valid for all', arrays);
```

Expand All @@ -76,19 +76,19 @@ If we wanted to fix the problem, we would need to use a comparison function:

```js
function sort(arr) {
return [].concat(arr).sort(function (a, b) {
return a - b;
});
return [].concat(arr).sort(function (a, b) {
return a - b;
});
}
```

```js
expect(function (arr) {
var sorted = sort(arr);
var sorted = sort(arr);

expect(sorted, 'to have length', arr.length)
.and('first item to be less than or equal to all', arr)
.and('last item to be greater than or equal to all', arr);
expect(sorted, 'to have length', arr.length)
.and('first item to be less than or equal to all', arr)
.and('last item to be greater than or equal to all', arr);
}, 'to be valid for all', arrays);
```

Expand Down Expand Up @@ -130,9 +130,9 @@ Include the library with RequireJS the following way:

```js#evaluate:false
define(['unexpected', 'unexpected-check'], funtion (unexpected, unexpectedCheck) {
var expect = unexpected.clone();
expect.use(unexpectedCheck);
// Your code
var expect = unexpected.clone();
expect.use(unexpectedCheck);
// Your code
});
```

Expand Down

0 comments on commit ec2af7e

Please sign in to comment.