Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between spec and test folders

I have a concept problem, I am working on a rails project & as per my knowledge both the test & spec are used for tests. Where test refers to unit testing & spec refers to integration testing. But I want to have to have full idea about those two folders & if they both refers to test then what is the major difference between them?

like image 360
Lalit Avatar asked Feb 16 '18 13:02

Lalit


People also ask

Why are test files called spec?

specification (meaning test file). was idiomatic in jasmine I think. It's loosely a way of writing tests, as a specification (or set of expectations) rather than a more assertive style.

What is Tests folder?

So, test folder contains test source files under src/test/java , and test resources - under src/test/resources . Also as a good practice Spring Boot includes test class, that validates that your application context starts properly.

What are spec tests?

What are test specifications? Test specifications (specs) are the string used to identify tests when they're run by a test runner. Below you can see an example of the output from a failed test. You can see where the specification and assertion error is used to describe how a test failed.

Where is spec folder in Rails?

Request specs reside in the spec/requests directory. The directory can also be named integration or api . Feature specs reside in the spec/features directory.


1 Answers

Rails default testing framework gives you test folder for you rails default testing framework, if you want to use RSpec testing framework, which gives you folder called 'spec' RSPEC, it is your wish to select which option, RSPEC specs are more readable, people use both ways.

like image 179
Manoj Menon Avatar answered Oct 01 '22 22:10

Manoj Menon