We covered a lot of new material throughout this chapter, so to aid understanding, I recommend doing the following exercises:
- Create a Ruby-based web service,
book-library
, to store books:
The acceptance criteria are delivered in the form of the following Cucumber feature:
Scenario: Store book in the library Given Book "The Lord of the Rings" by "J.R.R. Tolkien" with ISBN number "0395974682" When I store the book in library Then I am able to retrieve the book by the ISBN number
- Write step definitions for the Cucumber test
- Write the web service (the simplest way is to use the Sinatra framework: http://www.sinatrarb.com/, but you can also use Ruby on Rails)
- The book should have the following attributes: name, author, and ISBN
- The web service should have the following endpoints:
- POST
/books
to add a book - GET
books/<isbn>
to retrieve the book
- POST
- The data can be stored in the memory
- At the end, check that the acceptance test is green
- Add
book-library
as a Docker image to the Docker registry...