Coder Social home page Coder Social logo

hspec-snap's Introduction

About

hspec-snap is a library to allow you to write tests against Snap web applications in the context of an hspec test suite.

Usage

The basic usage is that within an hspec test suite, you can insert a block with snap, within which all of the normal spec organization tools work (describe, context, and it), but the content of the actual tests should be tests in the Snap context. These tests can make requests against your application, run arbitrary handler functions, and assert various HTTP statuses, content of HTML pages, or just plain unit tests. You can't mix in other types of tests within the snap block, and you can't share values between different unit tests (a unit test being what's inside an it), but you can have any number of snap blocks, and can make any number of assertions within a unit test block (from HSpec's perspective, though, it is just one test).

To get started, take a look at the test suite within the spec/ directory.

Examples

The easiest examples to look at are in the test suite in the spec/ directory.

Tests

You can run the test suite with stack test if you are using stack, or cabal test if not. When the robots last ran the suite, it: Circle CI

License

BSD3

Contributors

Daniel Patterson ([email protected])

Tim Adams ([email protected])

Greg Hale ([email protected])

hspec-snap's People

Contributors

dbp avatar dmjio avatar imalsogreg avatar juanpaucar avatar timmytofu avatar tiredpixel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hspec-snap's Issues

Dependencies on hspec < 2.1

I just built it against 2.1.4 and all the tests pass. Am I missing something here? This restriction is preventing hspec-snap from working with Stackage.

snap 1.0

Would you mind having a branch targeting snap 1.0? If you don't already have one in the works I can try to get it working and send a PR along with a script to grab the dependencies from github (until 1.0 gets released).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.