【发布时间】:2014-10-08 10:12:00
【问题描述】:
我正在使用Bootcamp 进行单元测试。在官方 Bootcamp 教程中有一个示例测试套装。它为您提供三个文件:
函数/数学
@function power($base, $exponent) {
$result: 1;
@if $exponent >= 0 {
@for $i from 1 through $exponent {
$result: $result * $base;
}
} @else {
@for $i from $exponent to 0 {
$result: $result / $base;
}
}
@return $result;
}
specs/math.scss
@include describe("Math Power") {
@include it("should expect positive values to be calculated correctly") {
@include should( expect( power( 10, 2) ), to( equal( 100 )));
@include should( expect( power( 2, 2) ), to( equal( 4 )));
@include should( expect( power(0.5, 2) ), to( equal( 0.25 )));
}
@include it("should expect negative values to be calculated correctly") {
@include should( expect( power( 10, -2) ), to( equal( 0.01 )));
@include should( expect( power( 2, -2) ), to( equal( 0.25 )));
@include should( expect( power(0.5, -2) ), to( equal( 4 )));
}
}
specs.scss
@import "functions/math";
@import "bootcamp";
$bc-setting-verbose: false;
$bc-setting-warnings: false;
@include runner-start;
@import "specs/math";
@include runner-end;
我知道 3 号只是很粗鲁,不是吗?但是我不知道数字 1 和 2 中使用的是什么语言。今天我发现了 Compass 和 Framework Bootcamp 是什么框架,我不知道我在读的是 Compass 还是 Bootcamp。
【问题讨论】:
-
Bootcamp 和 Compass 不是语言。
-
好的。你说得对。我只想知道数字 1 和 2 写的是什么。
标签: sass compass-sass