Skip to content

Commit bbb6434

Browse files
committed
Updates for PureScript 0.8
1 parent 3ede58f commit bbb6434

File tree

9 files changed

+50
-85
lines changed

9 files changed

+50
-85
lines changed

.jscsrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"preset": "grunt",
3+
"disallowSpacesInFunctionExpression": null,
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
38
"disallowSpacesInAnonymousFunctionExpression": null,
49
"requireSpacesInAnonymousFunctionExpression": {
510
"beforeOpeningRoundBrace": true,

.jshintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"freeze": true,
66
"funcscope": true,
77
"futurehostile": true,
8-
"globalstrict": true,
8+
"strict": "global",
99
"latedef": true,
1010
"maxparams": 1,
1111
"noarg": true,
@@ -15,5 +15,6 @@
1515
"singleGroups": true,
1616
"undef": true,
1717
"unused": true,
18-
"eqnull": true
18+
"eqnull": true,
19+
"predef": ["exports"]
1920
}

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 0.10
4+
- 5
55
env:
66
- PATH=$HOME/purescript:$PATH
77
install:
88
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
99
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
1010
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
1111
- chmod a+x $HOME/purescript
12+
- npm install -g bower
1213
- npm install
1314
script:
1415
- npm run build
16+
after_success:
17+
- >-
18+
test $TRAVIS_TAG &&
19+
psc-publish > .pursuit.json &&
20+
curl -X POST http://pursuit.purescript.org/packages \
21+
-d @.pursuit.json \
22+
-H 'Accept: application/json' \
23+
-H "Authorization: token ${GITHUB_TOKEN}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Basic assertions library for low level testing. This is primarily for testing th
1212
bower install purescript-assert
1313
```
1414

15-
## Module documentation
15+
## Documentation
1616

17-
[`Test.Assert`](docs/Test/Assert.md)
17+
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-assert).

bower.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"name": "purescript-assert",
33
"homepage": "https://github.com/purescript/purescript-assert",
44
"description": "Basic assertions library for low level testing",
5-
"keywords": [
6-
"purescript",
7-
"assert"
8-
],
95
"license": "MIT",
106
"repository": {
117
"type": "git",
@@ -21,6 +17,6 @@
2117
"package.json"
2218
],
2319
"dependencies": {
24-
"purescript-eff": "^0.1.0"
20+
"purescript-eff": "^1.0.0"
2521
}
2622
}

docs/Test/Assert.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"private": true,
33
"scripts": {
44
"postinstall": "pulp dep install",
5-
"build": "jshint src && jscs src && pulp build && rimraf docs && pulp docs"
5+
"clean": "rimraf output && rimraf .pulp-cache",
6+
"build": "jshint src && jscs src && pulp build"
67
},
78
"devDependencies": {
8-
"jscs": "^1.13.1",
9-
"jshint": "^2.8.0",
10-
"pulp": "^4.0.1",
11-
"rimraf": "^2.4.1"
9+
"jscs": "^2.8.0",
10+
"jshint": "^2.9.1",
11+
"pulp": "^7.0.0",
12+
"rimraf": "^2.5.0"
1213
}
1314
}

src/Test/Assert.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* global exports */
21
"use strict";
32

43
// module Test.Assert

src/Test/Assert.purs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
module Test.Assert
2-
( assert'
2+
( ASSERT
33
, assert
4+
, assert'
45
, assertThrows
56
, assertThrows'
6-
, ASSERT()
77
) where
88

9-
import Control.Monad.Eff (Eff())
10-
import Prelude
9+
import Control.Monad.Eff (Eff)
10+
import Control.Monad ((=<<))
11+
import Data.Unit (Unit)
1112

1213
-- | Assertion effect type.
1314
foreign import data ASSERT :: !
@@ -19,7 +20,11 @@ assert = assert' "Assertion failed"
1920

2021
-- | Throws a runtime exception with the specified message when the boolean
2122
-- | value is false.
22-
foreign import assert' :: forall e. String -> Boolean -> Eff (assert :: ASSERT | e) Unit
23+
foreign import assert'
24+
:: forall e
25+
. String
26+
-> Boolean
27+
-> Eff (assert :: ASSERT | e) Unit
2328

2429
-- | Throws a runtime exception with message "Assertion failed: An error should
2530
-- | have been thrown", unless the argument throws an exception when evaluated.
@@ -29,7 +34,8 @@ foreign import assert' :: forall e. String -> Boolean -> Eff (assert :: ASSERT |
2934
-- | satisfied. Functions which use `Eff (err :: EXCEPTION | eff) a` can be
3035
-- | tested with `catchException` instead.
3136
assertThrows :: forall e a. (Unit -> a) -> Eff (assert :: ASSERT | e) Unit
32-
assertThrows = assertThrows' "Assertion failed: An error should have been thrown"
37+
assertThrows =
38+
assertThrows' "Assertion failed: An error should have been thrown"
3339

3440
-- | Throws a runtime exception with the specified message, unless the argument
3541
-- | throws an exception when evaluated.
@@ -38,9 +44,14 @@ assertThrows = assertThrows' "Assertion failed: An error should have been thrown
3844
-- | to make sure that an exception is thrown if a precondition is not
3945
-- | satisfied. Functions which use `Eff (err :: EXCEPTION | eff) a` can be
4046
-- | tested with `catchException` instead.
41-
assertThrows' :: forall e a. String -> (Unit -> a) -> Eff (assert :: ASSERT | e) Unit
42-
assertThrows' msg fn =
43-
checkThrows fn >>= assert' msg
44-
45-
46-
foreign import checkThrows :: forall e a. (Unit -> a) -> Eff (assert :: ASSERT | e) Boolean
47+
assertThrows'
48+
:: forall e a
49+
. String
50+
-> (Unit -> a)
51+
-> Eff (assert :: ASSERT | e) Unit
52+
assertThrows' msg fn = assert' msg =<< checkThrows fn
53+
54+
foreign import checkThrows
55+
:: forall e a
56+
. (Unit -> a)
57+
-> Eff (assert :: ASSERT | e) Boolean

0 commit comments

Comments
 (0)