-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed rule for sides validation and added tests
- Loading branch information
Showing
4 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
load("init.js"); | ||
|
||
|
||
testSpec("sides.gspec", [], function (spec) { | ||
assertSpec(spec) | ||
.hasRuleSection("box-* sides are inside main_container with 5px margin from top and bottom", { | ||
"box-1": ["inside main_container 5px top"], | ||
"box-2": ["inside main_container"], | ||
"box-3": ["inside main_container 5px bottom"] | ||
}) | ||
.hasRuleSection("box-* sides are vertically inside main_container with 4px margin", { | ||
"box-1": ["inside main_container 4px top"], | ||
"box-2": ["inside main_container"], | ||
"box-3": ["inside main_container 4px bottom"] | ||
}) | ||
.hasRuleSection("box-* sides are vertically inside main_container", { | ||
"box-1": ["inside main_container -1 to 1 px top"], | ||
"box-2": ["inside main_container"], | ||
"box-3": ["inside main_container -1 to 1 px bottom"] | ||
}) | ||
.hasRuleSection("box-* sides are horizontally inside main_container with 3px margin", { | ||
"box-1": ["inside main_container 3px left"], | ||
"box-2": ["inside main_container"], | ||
"box-3": ["inside main_container 3px right"] | ||
}) | ||
.hasRuleSection("box-* sides are horizontally inside main_container", { | ||
"box-1": ["inside main_container -1 to 1 px left"], | ||
"box-2": ["inside main_container"], | ||
"box-3": ["inside main_container -1 to 1 px right"] | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@import init.gspec | ||
@script sides.mock.js | ||
|
||
= Main = | ||
| box-* sides are inside main_container with 5px margin from top and bottom | ||
|
||
| box-* sides are vertically inside main_container with 4px margin | ||
|
||
| box-* sides are vertically inside main_container | ||
|
||
| box-* sides are horizontally inside main_container with 3px margin | ||
|
||
| box-* sides are horizontally inside main_container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
var boxes = [ | ||
{name: "box-1"}, | ||
{name: "box-2"}, | ||
{name: "box-3"} | ||
]; | ||
|
||
mockFunction("findAll") | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) | ||
.thenReturn(boxes) |