sass-spec
sass-spec copied to clipboard
Add specs for built-in functions
All the built-in functions need thorough specs that exercise their edge and error cases. There isn't currently a great structure in place for this; some functions have some specs scattered around the repo, but there should be a uniform location and we should make sure all functions are tested.
Ruby Sass has good test coverage for functions, so the best way to go about this is probably porting those. I suggest the following structure:
spec/
'-- core_function/
|-- color/
| ...
'-- number/
|-- round/
| ...
'-- max/
|-- success/
| |-- input.scss
| '-- expected_output.scss
'-- error/
|-- type_error_arg1/
| |-- input.scss
| '-- expected_output.scss
'-- type_error_arg2/
|-- input.scss
'-- expected_output.scss
For functions with more complex modes of operation, we could replace success/
with multiple test cases.
We should also retrofit the existing spec/colors/
, spec/number-functions/
, and spec/selector-functions/
into this format.
For the time being, I'm adding this structure lazily when I need to create a spec for a function.
@nex3 Can this be considered done now ?