--- title: "RSpec: Behaviour Driven Development for Ruby" --- section.hero article.hero-text = image_tag 'logo.png', :alt => "RSpec Logo" div | Behaviour Driven br | Development for Ruby. div Making TDD Productive and Fun. section.get-started article.steps h2 Let's get started! p | To kick things off, install RSpec and run rspec --init to set up your project to use RSpec. = asciinema_video 14095, speed: 3 p | Start with a very simple example that expresses some basic desired behaviour. = asciinema_video 14100, speed: 4 p Run the example and watch it fail. = asciinema_video 14101, speed: 2 p | Implement that basic behaviour... = asciinema_video 14102, speed: 2 p Run the example and bask in the joy that is green. = asciinema_video 14103, speed: 2 h3 Take very small steps p | Don’t rush ahead with more code. Instead, add another example and let it guide you to what you have to do next. And don’t forget to take time to refactor your code before it gets messy. You should keep your code clean at every step of the way. article.docs = link_to "View Documentation", "/documentation", :class => "btn" article.book = image_tag 'rspec3_book.jpg', :alt => "Effective Testing with RSpec 3", :class => "needs-border" div h2 The Book h3 Effective Testing with RSpec 3: Build Ruby Apps with Confidence p | This definitive guide from RSpec’s lead developer shows you how to use RSpec to drive more maintainable designs, specify and document expected behavior, and prevent regressions during refactoring. Build a project using RSpec to design, describe, and test the behavior of your code-whether you’re new to testing tools or an experienced developer. = link_to "New book now available!", "https://pragprog.com/book/rspec3/effective-testing-with-rspec-3", target: '_blank' p article.screencast = image_tag 'rspec_screencast.png', :alt => "Testing Ruby Application with RSpec Screencast" div h2 The Screencast p | The Testing Ruby Applications with RSpec screencast introduces the core RSpec libraries through the development of a small CLI card game. In addition to covering the technical aspects of using RSpec, it also covers best practices for using them so you get the most out of your test suite: different types of tests, what kinds of things to test, when different styles are appropriate. = link_to "Check out the screencast", "https://www.pluralsight.com/courses/rspec-ruby-application-testing", target: '_blank'