209
67
+ 1
0

What is RSpec?

Behaviour Driven Development for Ruby. Making TDD Productive and Fun.
RSpec is a tool in the Testing Frameworks category of a tech stack.
RSpec is an open source tool with 2.6K GitHub stars and 208 GitHub forks. Here鈥檚 a link to RSpec's open source repository on GitHub

Who uses RSpec?

Companies
85 companies reportedly use RSpec in their tech stacks, including StackShare, Aumni Web App, and eazel.

Developers
107 developers on StackShare have stated that they use RSpec.

RSpec Integrations

Why developers like RSpec?

Here鈥檚 a list of reasons why companies and developers use RSpec
Top Reasons
Be the first to leave a pro
RSpec Reviews

Here are some stack decisions, common use cases and reviews by companies and developers who chose RSpec in their tech stack.

Simon Bettison
Simon Bettison
Managing Director at Bettison.org Limited | 7 upvotes 143K views
atBettison.org LimitedBettison.org Limited
PostgreSQL
PostgreSQL
Elasticsearch
Elasticsearch
Sidekiq
Sidekiq
Redis
Redis
Amazon ElastiCache
Amazon ElastiCache
Rails
Rails
RSpec
RSpec
Selenium
Selenium
Travis CI
Travis CI
Ruby
Ruby
Unicorn
Unicorn
nginx
nginx
Amazon CloudFront
Amazon CloudFront
Amazon SES
Amazon SES
Amazon SQS
Amazon SQS
Amazon Route 53
Amazon Route 53
Amazon VPC
Amazon VPC
Docker
Docker
Amazon EC2 Container Service
Amazon EC2 Container Service

In 2010 we made the very difficult decision to entirely re-engineer our existing monolithic LAMP application from the ground up in order to address some growing concerns about it's long term viability as a platform.

Full application re-write is almost always never the answer, because of the risks involved. However the situation warranted drastic action as it was clear that the existing product was going to face severe scaling issues. We felt it better address these sooner rather than later and also take the opportunity to improve the international architecture and also to refactor the database in. order that it better matched the changes in core functionality.

PostgreSQL was chosen for its reputation as being solid ACID compliant database backend, it was available as an offering AWS RDS service which reduced the management overhead of us having to configure it ourselves. In order to reduce read load on the primary database we implemented an Elasticsearch layer for fast and scalable search operations. Synchronisation of these indexes was to be achieved through the use of Sidekiq's Redis based background workers on Amazon ElastiCache. Again the AWS solution here looked to be an easy way to keep our involvement in managing this part of the platform at a minimum. Allowing us to focus on our core business.

Rails ls was chosen for its ability to quickly get core functionality up and running, its MVC architecture and also its focus on Test Driven Development using RSpec and Selenium with Travis CI providing continual integration. We also liked Ruby for its terse, clean and elegant syntax. Though YMMV on that one!

Unicorn was chosen for its continual deployment and reputation as a reliable application server, nginx for its reputation as a fast and stable reverse-proxy. We also took advantage of the Amazon CloudFront CDN here to further improve performance by caching static assets globally.

We tried to strike a balance between having control over management and configuration of our core application with the convenience of being able to leverage AWS hosted services for ancillary functions (Amazon SES , Amazon SQS Amazon Route 53 all hosted securely inside Amazon VPC of course!).

Whilst there is some compromise here with potential vendor lock in, the tasks being performed by these ancillary services are no particularly specialised which should mitigate this risk. Furthermore we have already containerised the stack in our development using Docker environment, and looking to how best to bring this into production - potentially using Amazon EC2 Container Service

See more
Jerome Dalbert
Jerome Dalbert
Senior Backend Engineer at StackShare | 6 upvotes 4.9K views
atStackShareStackShare
RSpec
RSpec
Rails
Rails
Ruby
Ruby

We use RSpec because it is a de-facto Rails industry standard.

minitest was an interesting alternative because it was part of the Ruby standard library, but this is not the case any more. Also, at the time of writing, the real-world-rails collection shows that it is used in only 31 Gemfiles vs 135 Gemfiles for RSpec.

RSpec works reliably well for an overwhelming majority of people who are used to it, so I guess that is why they don't see a need to change.

See more
Jerome Dalbert
Jerome Dalbert
Senior Backend Engineer at StackShare | 5 upvotes 216.9K views
atStackShareStackShare
GitHub
GitHub
CircleCI
CircleCI
Code Climate
Code Climate
Brakeman
Brakeman
RuboCop
RuboCop
RSpec
RSpec
Rails
Rails
Git
Git
#ContinuousIntegration

The continuous integration process for our Rails backend app starts by opening a GitHub pull request. This triggers a CircleCI build and some Code Climate checks.

The CircleCI build is a workflow that runs the following jobs:

  • check for security vulnerabilities with Brakeman
  • check code quality with RuboCop
  • run RSpec tests in parallel with the knapsack gem, and output test coverage reports with the simplecov gem
  • upload test coverage to Code Climate

Code Climate checks the following:

  • code quality metrics like code complexity
  • test coverage minimum thresholds

The CircleCI jobs and Code Climate checks above have corresponding GitHub status checks.

Once all the mandatory GitHub checks pass and the code+functionality have been reviewed, developers can merge their pull request into our Git master branch. Code is then ready to deploy!

#ContinuousIntegration

See more
StackShare Editors
StackShare Editors
RSpec
RSpec
Chef
Chef
GitHub
GitHub
Jenkins
Jenkins

In late 2013, the Operations Engineering team at PagerDuty was made up of 4 engineers, and was comprised of generalists, each of whom had one or two areas of depth. Although the Operations Team ran its own on-call, each engineering team at PagerDuty also participated on the pager.

The Operations Engineering Team owned 150+ servers spanning multiple cloud providers, and used Chef to automate their infrastructure across the various cloud providers with a mix of completely custom cookbooks and customized community cookbooks.

Custom cookbooks were managed by Berkshelf, andach custom cookbook contained its own tests based on ChefSpec 3, coupled with Rspec.

Jenkins was used to GitHub for new changes and to handle unit testing of those features.

See more
Joel Davison
Joel Davison
Junior Web Developer at Ngakkan Nyaagu | 1 upvotes 2.1K views
atNgakkan NyaaguNgakkan Nyaagu
RSpec
RSpec

RSpec is used to run automated tests, mostly for the purpose of integration testing when developing on top of V1 of the API. RSpec

See more

RSpec Alternatives & Comparisons

What are some alternatives to RSpec?
Cucumber
Cucumber is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs.
Capybara
Capybara helps you test web applications by simulating how a real user would interact with your app. It is agnostic about the driver running your tests and comes with Rack::Test and Selenium support built in. WebKit is supported through an external gem.
JUnit
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
PHPUnit
PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
Mockito
It is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. It doesn鈥檛 give you hangover because the tests are very readable and they produce clean verification errors.
See all alternatives

RSpec's Followers
67 developers follow RSpec to keep up with related blogs and decisions.
Davide Manea
chadol lee
Nikita Fedyashev
Victor Spanner
Vin铆cius Marques
felix-starman
Nguy峄卬 Di峄噓
Syed Raza Khalid
Yosef Benny Widyokarsono
Giovanni Alberto