1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
Feature: Command Line
In order to manage my stylesheets
As a user on the command line
I want to create a new project
Scenario: Install a project without a framework
When I create a project using: compass create my_project
Then a directory my_project/ is created
And a configuration file my_project/config.rb is created
And a sass file my_project/sass/screen.scss is created
And a sass file my_project/sass/print.scss is created
And a sass file my_project/sass/ie.scss is created
And a css file my_project/stylesheets/screen.css is created
And a css file my_project/stylesheets/print.css is created
And a css file my_project/stylesheets/ie.css is created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
Scenario: Install a project with blueprint
When I create a project using: compass create bp_project --using blueprint
Then a directory bp_project/ is created
And a configuration file bp_project/config.rb is created
And a sass file bp_project/sass/screen.scss is created
And a sass file bp_project/sass/print.scss is created
And a sass file bp_project/sass/ie.scss is created
And a css file bp_project/stylesheets/screen.css is created
And a css file bp_project/stylesheets/print.css is created
And a css file bp_project/stylesheets/ie.css is created
And an image file bp_project/images/grid.png is created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "lt IE 8" to /stylesheets/ie.css for media "screen, projection"
Scenario: Install a project with specific directories
When I create a project using: compass create custom_project --using blueprint --sass-dir sass --css-dir css --images-dir assets/imgs
Then a directory custom_project/ is created
And a directory custom_project/sass/ is created
And a directory custom_project/css/ is created
And a directory custom_project/assets/imgs/ is created
And a sass file custom_project/sass/screen.scss is created
And a css file custom_project/css/screen.css is created
And an image file custom_project/assets/imgs/grid.png is created
Scenario: Perform a dry run of creating a project
When I create a project using: compass create my_project --dry-run
Then a directory my_project/ is not created
But a configuration file my_project/config.rb is reported created
And a sass file my_project/sass/screen.scss is reported created
And a sass file my_project/sass/print.scss is reported created
And a sass file my_project/sass/ie.scss is reported created
And I am told how to link to /stylesheets/screen.css for media "screen, projection"
And I am told how to link to /stylesheets/print.css for media "print"
And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
Scenario: Creating a bare project
When I create a project using: compass create bare_project --bare
Then a directory bare_project/ is created
And a configuration file bare_project/config.rb is created
And a directory bare_project/sass/ is created
And a directory bare_project/stylesheets/ is not created
And I am congratulated
And I am told that I can place stylesheets in the sass subdirectory
And I am told how to compile my sass stylesheets
Scenario: Compiling a project with errors
Given I am using the existing project in test/fixtures/stylesheets/compass
And the project has a file named "sass/error.scss" containing:
"""
.broken {
"""
When I run: compass compile
Then the command exits with a non-zero error code
Scenario: Creating a bare project with a framework
When I create a project using: compass create bare_project --using blueprint --bare
Then an error message is printed out: A bare project cannot be created when a framework is specified.
And the command exits with a non-zero error code
Scenario: Compiling an existing project.
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
Then a directory tmp/ is created
And a css file tmp/layout.css is created
And a css file tmp/print.css is created
And a css file tmp/reset.css is created
And a css file tmp/utilities.css is created
Scenario: Compiling an existing project with a specified project
Given I am using the existing project in test/fixtures/stylesheets/compass
And I am in the parent directory
When I run: compass compile tmp_compass
Then a directory tmp_compass/tmp/ is created
And a css file tmp_compass/tmp/layout.css is created
And a css file tmp_compass/tmp/print.css is created
And a css file tmp_compass/tmp/reset.css is created
And a css file tmp_compass/tmp/utilities.css is created
Scenario: Dry Run of Compiling an existing project.
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile --dry-run
Then a directory tmp/ is not created
And a css file tmp/layout.css is not created
And a css file tmp/print.css is not created
And a css file tmp/reset.css is not created
And a css file tmp/utilities.css is not created
And a css file tmp/layout.css is reported created
And a css file tmp/print.css is reported created
And a css file tmp/reset.css is reported created
And a css file tmp/utilities.css is reported created
Scenario: Recompiling a project with no changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run: compass compile
Scenario: compiling a specific file in a project
Given I am using the existing project in test/fixtures/stylesheets/compass
And I run: compass compile sass/utilities.scss
Then a sass file sass/layout.sass is not mentioned
And a sass file sass/print.sass is not mentioned
And a sass file sass/reset.sass is not mentioned
And a css file tmp/utilities.css is reported created
And a css file tmp/utilities.css is created
Scenario: Re-compiling a specific file in a project with no changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run: compass compile sass/utilities.scss
Then a sass file sass/layout.sass is not mentioned
And a sass file sass/print.sass is not mentioned
And a sass file sass/reset.sass is not mentioned
And a css file tmp/utilities.css is reported identical
Scenario: Installing a pattern into a project
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass install blueprint/buttons
Then a sass file sass/buttons.scss is created
And an image file images/buttons/cross.png is created
And an image file images/buttons/key.png is created
And an image file images/buttons/tick.png is created
And a css file tmp/buttons.css is created
Scenario: Basic help
When I run: compass help
Then I should see the following "primary" commands:
| clean |
| compile |
| create |
| init |
| watch |
And I should see the following "other" commands:
| config |
| extension |
| frameworks |
| grid-img |
| help |
| imports |
| install |
| interactive |
| sprite |
| stats |
| unpack |
| validate |
| version |
Scenario: Recompiling a project with no material changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I wait 1 second
And I touch sass/layout.sass
And I run: compass compile
Then a css file tmp/layout.css is reported identical
Scenario: Recompiling a project with changes
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I wait 1 second
And I add some sass to sass/layout.sass
And I run: compass compile
And a css file tmp/layout.css is reported overwritten
Scenario: Cleaning a project
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run: compass clean
Then the following files are reported removed:
| .sass-cache/ |
| tmp/border_radius.css |
| tmp/box.css |
| tmp/box_shadow.css |
| tmp/columns.css |
| tmp/fonts.css |
| images/flag-s4798b5a210.png |
And the following files are removed:
| .sass-cache/ |
| tmp/border_radius.css |
| tmp/box.css |
| tmp/box_shadow.css |
| tmp/columns.css |
| tmp/fonts.css |
| images/flag-s4798b5a210.png |
Scenario: Watching a project for changes
Given ruby supports fork
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile
And I run in a separate process: compass watch
And I wait 3 seconds
And I touch sass/layout.sass
And I wait 2 seconds
And I shutdown the other process
Then a css file tmp/layout.css is reported identical
Scenario: Generating a grid image so that I can debug my grid alignments
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 30+10x24
Then a png file images/grid.png is created
And the image images/grid.png has a size of 40x24
Scenario: Generating a grid image to a specified path with custom dimensions
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 50+10x24 assets/wide_grid.png
Then a directory assets is created
Then a png file assets/wide_grid.png is created
And the image assets/wide_grid.png has a size of 60x24
Scenario: Generating a grid image with invalid dimensions
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass grid-img 50x24 assets/wide_grid.png
Then a directory assets is not created
And a png file assets/wide_grid.png is not created
Scenario: Generate a compass configuration file
Given I should clean up the directory: config
When I run: compass config config/compass.rb --sass-dir sass --css-dir assets/css
Then a configuration file config/compass.rb is created
And the following configuration properties are set in config/compass.rb:
| property | value |
| sass_dir | sass |
| css_dir | assets/css |
Scenario Outline: Print out a configuration value
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass config -p <property>
Then I should see the following output: <value>
And the command exits <exit>
Examples:
| property | value | exit |
| extensions_dir | extensions | normally |
| extensions_path | $PROJECT_PATH/extensions | normally |
| css_dir | tmp | normally |
| css_path | $PROJECT_PATH/tmp | normally |
| sass_dir | sass | normally |
| sass_path | $PROJECT_PATH/sass | normally |
| foobar | ERROR: configuration property 'foobar' does not exist | with a non-zero error code |
@validator
Scenario: Validate the generated CSS
Given I am using the existing project in test/fixtures/stylesheets/valid
When I run: compass validate
Then my css is validated
And I am informed that my css is valid.
@stats
Scenario: Get stats for my project
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass stats
Then I am told statistics for each file:
| Filename | Rules | Properties | Mixins Defs | Mixins Used | Filesize | CSS Selectors | CSS Properties | CSS Filesize |
| sass/border_radius.scss | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/box.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/fonts.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/gradients.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/image_size.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/images.scss | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/layout.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/legacy_clearfix.scss | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/lists.scss | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/print.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/reset.sass | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| sass/utilities.scss | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
| Total.* | \d+ | \d+ | \d+ | \d+ | \d+ K?B | \d+ | \d+ | \d+ K?B |
@listframeworks
Scenario: List frameworks registered with compass
When I run: compass frameworks
Then I should see the following lines of output:
| blueprint |
| compass |
|