Setting up
Let's go ahead and create an application. We will be using Sinatra as a framework for our application. That means that we will be using Ruby as a programming language. You can read more about Sinatra here
There are several ways to create a new Sinatra application but we will make use of a script that creates an app for us AND configures it (at least partially) for use with Cucumber and another testing framework called RSpec.
Open your Gemfile
and add the following lines:
Then run bundle install
to install the new gem we just added.
after the installation is complete, run:
If prompted with what actions the generator should take:
Go ahead and choose 2. overwrite
There will be a lot of new files created and we will go over all of them in a while. For now, I want you to open up your Gemfile
again and add:
Run bundle install
to install new gem then run cucumber
again.
The first step (in both scenarios) is passing. That is a really good sign!
Before we move to the next step we need to re-arrange a few things:
Create a
lib
folderMove
application.rb
to the newly createdlib
folderUpdate path to
application.rb
infeatures/support/env.rb
Open the file with your text editor. At the top of that file you'll should see the following line
Run
cucumber
again to make sure the 2 steps from earlier on are still passing :-)
Great! That's all for now. Let's move to the next step where we'll get a few more steps in our scenarios to pass.
Last updated