Skip to content

Instantly share code, notes, and snippets.

@b1tfury
Last active March 3, 2016 14:44
Show Gist options
  • Save b1tfury/dc99e01fbeb8a2dabda1 to your computer and use it in GitHub Desktop.
Save b1tfury/dc99e01fbeb8a2dabda1 to your computer and use it in GitHub Desktop.
Rspec

What is Rspec?

It is TDD framework, which aims to make Test-Driven Development a more joyful and productive experience with tools that elevate the design and documentation aspects of TDD to first-class citizenship.

subject code

The code whose behavior we are specifying with RSpec.

expectation

An expression of how the subject code is expected to behave.

code example

An executable example of how the subject code can be used and its expected behavior (expressed with expectations) in a given context.

example group

A group of code examples.

spec, aka spec file

A file that contains one or more example groups.

Today I’ll discuss about how to organize executable code examples in example groups in a number of different ways,

run arbitrary bits of code before and after each example, and

even share examples across groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment