Git Product home page Git Product logo

bdd-rails's Introduction

BDD Rails: A starter kit

Gem Version Build Status

Hello there! So you think BDD is a great way to talk about software? Are you ready to codify some of those conversations? Do you build apps in rails? If so you've come to the right place.

bdd-rails was built to provide a set of generators for a rails app. We provide an opinionated setup for using rspec + capybara to feature test your application.

BDD starts with conversations

Many think BDD is about a certain testing style, it is and it isn't. BDD is much more about the conversations around the desired and undesired behaviour of a system.

If you're not having conversations about your system in a BDD style then that is where you should start!

Codifying Behaviour

Coming soon... for now read the following articles to find out about the style of tests we're writing:

Creating a new rails app

Firstly, make sure you have rails installed!

gem install rails

Now let's create a new app!

rails new --skip-test-unit my_bdd_app
cd my_bdd_app

Next we want to install bdd-rails:

echo "gem 'bdd-rails', path: '../../'" >> Gemfile
bundle

We want to install our BDD setup in your rails app:

bundle exec rails g bdd_rails:install

And setup our DB:

bundle exec rake db:migrate

Now you can run your (empty) test suite:

bundle exec rspec

How about an example?

To install a full example of feature test and code into your application run the following:

bundle exec rails g bdd_rails:example
bundle exec rspec

Now you have a passing example! Feel free to explore the example code :)

bdd-rails's People

Contributors

lukemorton avatar agata-anastazja avatar

Watchers

James Cloos avatar

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.