Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Deprecated as of 10.7.0. Please use highlight(code, options) instead.

Step 1 - Webspicy is a bit like curl

Please make sure your are on step 1 in your terminal by typing:

bin/step 1

Let's compare curl and webspicy

In this first step, we will show you that webspicy is a simple HTTP client, a bit like curl. The difference is that it allows making assertions about the content received from an API.

If you completed the intro, you should be able to reach our API example with curl:

{"name":"TODOS API","version":"0.0.1"}

Let's now do the same using webspicy:

GET it returns a 200
  meets its specification

Finished in 0.00779 seconds (files took 0.01864 seconds to load)
1 example, 0 failures

webspicy is a specification & test framework

While curl calls the web service and shows the output, webspicy takes it as an API test that succeeds if it returns a 200 status code.

That's because webspicy is a test framework, that checks whether a web service meets a specification. Here it used a default specification that you can see with the --debug flag:

webspicy --debug
name: |-
  Default specification
url: |-

- method: |-
  description: |-

  input_schema: |-
  output_schema: |-
  error_schema: |-

    - description: |-
        it returns a 200
      params: {}
        status: 200

We will write our own specifications in next steps!