Skip to content

Commit

Permalink
Merge pull request #12 from JuliaLang/bettertests
Browse files Browse the repository at this point in the history
Modernize tests + testing infrastructure
  • Loading branch information
IainNZ committed Aug 25, 2014
2 parents 506f5b0 + f5305f3 commit 9947d68
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 33 deletions.
27 changes: 12 additions & 15 deletions .travis.yml
Expand Up @@ -2,23 +2,20 @@ language: cpp
compiler:
- clang
notifications:
email:
- zach.allaun@gmail.com
- daniel@danielespeset.com
email: false
env:
- JULIAVERSION="juliareleases"
- JULIAVERSION="julianightlies"
before_install:
- sudo add-apt-repository ppa:staticfloat/julia-deps -y
- sudo add-apt-repository ppa:staticfloat/julianightlies -y
- sudo add-apt-repository ppa:staticfloat/${JULIAVERSION} -y
- sudo apt-get update -qq -y
- sudo apt-get install libpcre3-dev julia -y
- git config --global user.name "Zach Allaun"
- git config --global user.email "zach.allaun@gmail.com"
- git submodule update --init --recursive
- git config --global user.name "Travis User"
- git config --global user.email "travis@example.net"
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
script:
- julia -e "Pkg.init()"
- julia -e 'Pkg.add("BinDeps")'
- julia -e 'Pkg.add("Dates")'
- julia -e 'Pkg.add("HttpParser")'
- julia -e 'Pkg.add("FactCheck")'
- mkdir -p ~/.julia/HttpCommon
- cp -R ./* ~/.julia/HttpCommon/
- julia ~/.julia/HttpCommon/test/test.jl
- julia -e 'Pkg.init(); Pkg.clone(pwd())'
- julia -e 'Pkg.test("HttpCommon", coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("HttpCommon")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
17 changes: 5 additions & 12 deletions README.md
@@ -1,9 +1,12 @@
# HttpCommon
# HttpCommon.jl

[![Build Status](https://travis-ci.org/hackerschool/HttpCommon.jl.png)](https://travis-ci.org/hackerschool/HttpCommon.jl)
[![Build Status](https://travis-ci.org/JuliaLang/HttpCommon.jl.svg?branch=master)](https://travis-ci.org/JuliaLang/HttpCommon.jl)
[![Coverage Status](https://img.shields.io/coveralls/JuliaLang/HttpCommon.jl.svg)](https://coveralls.io/r/JuliaLang/HttpCommon.jl)

This package provides types and helper functions for dealing with the HTTP protocol in Julia.

**Installation**: `julia> Pkg.add("HttpCommon")`

* types to represent `Request`s, `Response`s, and `Headers`
* a dictionary of `STATUS_CODES`
(maps integer codes to string descriptions; covers all the codes from the RFCs)
Expand All @@ -12,17 +15,7 @@ This package provides types and helper functions for dealing with the HTTP proto
* a pair of functions to `encodeURI` and `decodeURI`
* a function to turn a query string from a url into a `Dict{String,String}`

# Installation

```jl
# in REQUIRE
HttpCommon 0.0-

# in REPL
julia> Pkg.add("HttpCommon")
```

You will need to have Julia installed from source because this code has not been tested in v0.1 at all and probably uses features not found there.

~~~~
:::::::::::::
Expand Down
5 changes: 2 additions & 3 deletions REQUIRE
@@ -1,3 +1,2 @@
julia 0.2-
Dates
FactCheck 0.1.0-
julia 0.3
Dates
2 changes: 2 additions & 0 deletions test/REQUIRE
@@ -0,0 +1,2 @@
Dates
FactCheck
6 changes: 3 additions & 3 deletions test/test.jl → test/runtests.jl
@@ -1,12 +1,12 @@
using FactCheck
using Calendar
using HttpCommon
using Dates

facts("HttpCommon utility functions") do

context("RFC1123 compliant datetimes") do
@fact RFC1123_datetime(ymd_hms(2013, 5, 2, 13, 45, 7, "PST")) =>
"Thu, 02 May 2013 20:45:07 GMT"
@fact RFC1123_datetime(DateTime(2013, 5, 2, 13, 45, 7)) =>
"Thu, 02 May 2013 13:45:07 GMT"
end

context("Escape HTML") do
Expand Down

0 comments on commit 9947d68

Please sign in to comment.