I am having a concept problem at this point & I can’t find any info about the differences between Test (UnitTest, etc) vs Spec (Rspec, etc).
As far as I know, specs is into Integration tests and test is into UnitTest but just that.
Can you explain what the differences are?
0
Look at the following diagram. It illustrates the relationship between Test-Driven Development (TDD) and Acceptance Test-Driven Development (ATDD):
Notice that the inner loop, TDD, is enveloped by the outer loop, ATDD. Requirements (illustrated by the Acceptance Criteria box) drive the creation of automated acceptance tests, which in turn drive the creation of Unit Tests for implementation.
In general, RSpec would be used in those situations where you want to express tests in a Business Analyst-friendly way, namely the creation of automated acceptance tests (the tan circle); whereas Unit Test frameworks like nUnit are more specialized for the sort of unit tests written from the developer’s TDD perspective at the implementation level (the yellow circle).
1
ok we have some different terms here, so here’s what’s going on
- We have Unit Testing. Other levels are integration testing, performance testing, etc.
- rspec can be used for many of the above levels of testing, e.g. against models, controllers and views through Capybara features tests.
- the word ‘spec’ comes from specification which is at the heart of a test – it specifies something.
- rspec – a framework used for testing agaist browsers, frequently used with Ruby on Rails applications.
- spec files – rspec file usually end in _spec.rb and are frequently called spec files.