What's the main difference between cucumber and shoulda?
Asked Answered
P

5

6

How would you make a decision between cucumber and shoulda if you were about to choose a testing framework?

What differentiates these two frameworks primarily?

Pelham answered 19/9, 2009 at 16:8 Comment(0)
H
10

As everybody has pointed out, Cucumber and Shoulda have fairly different objectives. You can think of Cucumber as being the "view from 10,000 feet" testing framework - you define a broad feature or specific user interaction and make sure everything works together. Shoulda is for unit testing - you pick out a specific model and thoroughly test all the picky little bits of functionality for that individual piece.

Usually, you would want to use these sort of frameworks in conjunction. For example, most of your broad, high level tests can be written in Cucumber, but when there's a particularly complex or opaque bit of code in your system, you can drill down with Shoulda or RSpec to test the particulars.

Heath answered 19/9, 2009 at 16:58 Comment(0)
S
3

They have completely different objectives. Shoulda is a unit testing extension built on top of Test::Unit.

Cucumber is a Acceptance/Functional Testing framework that can use Test::Unit/RSpec/Whatever for doing the assertions.

Shoulda can be directly compared to RSpec, for instance.

Sig answered 19/9, 2009 at 16:8 Comment(0)
V
3

I don't see anyone else mentioning that you actually can use Shoulda as the "test-engine" for Cucumber.

Vendetta answered 19/9, 2009 at 16:55 Comment(0)
T
1

Cucumber is targeting Acceptance Testing. Shoulda is a Unit Testing framework.

Transmute answered 19/9, 2009 at 16:37 Comment(0)
F
1

Shoulda is an extension of the Test::Unit framework that consists of test macros, assertions, and helpers. Shoulda is a prettier way to write unit tests.

Cucumber - a rewrite of RSpec's "Story runner" - is a tool for Behaviour-Driven Development. It allows you to write executable specifications in a business-readable domain-specific language. Cucumber is more an acceptance testing tool.

Cucumber and Shoulda have thus different objective (even if Shoulda can be used for BDD).

Flews answered 19/9, 2009 at 16:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.