2009-10-16 07:57:34 +00:00
|
|
|
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
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create my_project
|
2009-10-16 07:57:34 +00:00
|
|
|
Then a directory my_project/ is created
|
|
|
|
And a configuration file my_project/config.rb is created
|
2010-11-24 23:30:28 +00:00
|
|
|
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
|
2009-10-16 07:57:34 +00:00
|
|
|
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"
|
2009-10-17 00:36:29 +00:00
|
|
|
And I am told how to conditionally link "IE" to /stylesheets/ie.css for media "screen, projection"
|
|
|
|
|
|
|
|
Scenario: Install a project with blueprint
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create bp_project --using blueprint
|
2009-10-17 00:36:29 +00:00
|
|
|
Then a directory bp_project/ is created
|
|
|
|
And a configuration file bp_project/config.rb is created
|
2010-11-24 23:30:28 +00:00
|
|
|
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
|
2009-10-17 00:36:29 +00:00
|
|
|
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
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create custom_project --using blueprint --sass-dir sass --css-dir css --images-dir assets/imgs
|
2009-10-17 00:36:29 +00:00
|
|
|
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
|
2010-04-12 04:10:27 +00:00
|
|
|
And a sass file custom_project/sass/screen.scss is created
|
2009-10-17 00:36:29 +00:00
|
|
|
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
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create my_project --dry-run
|
2009-10-17 00:36:29 +00:00
|
|
|
Then a directory my_project/ is not created
|
|
|
|
But a configuration file my_project/config.rb is reported created
|
2010-11-24 23:30:28 +00:00
|
|
|
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
|
2009-10-17 00:36:29 +00:00
|
|
|
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"
|
|
|
|
|
2009-10-22 16:46:46 +00:00
|
|
|
Scenario: Creating a bare project
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create bare_project --bare
|
2009-10-22 16:46:46 +00:00
|
|
|
Then a directory bare_project/ is created
|
|
|
|
And a configuration file bare_project/config.rb is created
|
2010-11-24 23:30:28 +00:00
|
|
|
And a directory bare_project/sass/ is created
|
2009-10-24 22:21:08 +00:00
|
|
|
And a directory bare_project/stylesheets/ is not created
|
2009-10-22 16:46:46 +00:00
|
|
|
And I am congratulated
|
2010-11-24 23:30:28 +00:00
|
|
|
And I am told that I can place stylesheets in the sass subdirectory
|
2009-10-24 22:21:08 +00:00
|
|
|
And I am told how to compile my sass stylesheets
|
2009-10-22 16:46:46 +00:00
|
|
|
|
2011-07-03 07:18:58 +00:00
|
|
|
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
|
|
|
|
|
2009-10-22 16:46:46 +00:00
|
|
|
Scenario: Creating a bare project with a framework
|
2009-10-24 22:21:49 +00:00
|
|
|
When I create a project using: compass create bare_project --using blueprint --bare
|
2009-10-22 16:46:46 +00:00
|
|
|
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
|
2009-10-24 22:21:49 +00:00
|
|
|
|
2009-10-26 03:15:31 +00:00
|
|
|
Scenario: Initializing a rails project
|
2011-04-29 04:36:33 +00:00
|
|
|
Given ruby supports fork
|
2009-10-26 03:15:31 +00:00
|
|
|
Given I'm in a newly created rails project: my_rails_project
|
|
|
|
When I initialize a project using: compass init rails --sass-dir app/stylesheets --css-dir public/stylesheets/compiled
|
2009-11-14 17:37:36 +00:00
|
|
|
Then a config file config/compass.rb is reported created
|
|
|
|
Then a config file config/compass.rb is created
|
2010-04-12 04:10:27 +00:00
|
|
|
And a sass file app/stylesheets/screen.scss is created
|
|
|
|
And a sass file app/stylesheets/print.scss is created
|
|
|
|
And a sass file app/stylesheets/ie.scss is created
|
2009-10-26 03:15:31 +00:00
|
|
|
|
2009-10-24 22:21:49 +00:00
|
|
|
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
|
|
|
|
|
2010-05-30 14:02:07 +00:00
|
|
|
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
|
|
|
|
|
2009-10-24 22:21:49 +00:00
|
|
|
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
|
|
|
|
|
2009-12-16 16:42:51 +00:00
|
|
|
Scenario: compiling a specific file in a project
|
|
|
|
Given I am using the existing project in test/fixtures/stylesheets/compass
|
2010-05-30 14:32:58 +00:00
|
|
|
And I run: compass compile sass/utilities.scss
|
2009-12-16 16:42:51 +00:00
|
|
|
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
|
2010-05-30 14:32:58 +00:00
|
|
|
And I run: compass compile sass/utilities.scss
|
2009-12-16 16:42:51 +00:00
|
|
|
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
|
|
|
|
|
2009-10-26 05:18:46 +00:00
|
|
|
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
|
2010-04-12 04:10:27 +00:00
|
|
|
Then a sass file sass/buttons.scss is created
|
2009-10-26 05:18:46 +00:00
|
|
|
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
|
|
|
|
|
2009-10-25 00:46:59 +00:00
|
|
|
Scenario: Basic help
|
|
|
|
When I run: compass help
|
2009-11-15 20:28:03 +00:00
|
|
|
Then I should see the following "primary" commands:
|
2011-06-12 04:56:08 +00:00
|
|
|
| clean |
|
2009-11-15 20:28:03 +00:00
|
|
|
| compile |
|
|
|
|
| create |
|
|
|
|
| init |
|
|
|
|
| watch |
|
|
|
|
And I should see the following "other" commands:
|
|
|
|
| config |
|
2010-05-15 06:28:11 +00:00
|
|
|
| frameworks |
|
2009-11-15 20:28:03 +00:00
|
|
|
| grid-img |
|
|
|
|
| help |
|
2010-05-15 06:28:11 +00:00
|
|
|
| imports |
|
2009-11-15 20:28:03 +00:00
|
|
|
| install |
|
|
|
|
| interactive |
|
2010-11-30 06:04:26 +00:00
|
|
|
| sprite |
|
2009-11-15 20:28:03 +00:00
|
|
|
| stats |
|
2010-09-03 23:21:53 +00:00
|
|
|
| unpack |
|
2009-11-15 20:28:03 +00:00
|
|
|
| validate |
|
|
|
|
| version |
|
2009-10-25 00:46:59 +00:00
|
|
|
|
2009-10-24 22:21:49 +00:00
|
|
|
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
|
2009-10-25 00:53:02 +00:00
|
|
|
|
|
|
|
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
|
2009-10-25 07:45:34 +00:00
|
|
|
|
2011-06-12 04:56:08 +00:00
|
|
|
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 |
|
2011-07-26 18:42:57 +00:00
|
|
|
| images/flag-s*.png |
|
2011-06-12 04:56:08 +00:00
|
|
|
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 |
|
2011-07-26 18:42:57 +00:00
|
|
|
| images/flag-s*.png |
|
2011-06-12 04:56:08 +00:00
|
|
|
|
2009-10-25 07:45:34 +00:00
|
|
|
Scenario: Watching a project for changes
|
2011-04-29 04:36:33 +00:00
|
|
|
Given ruby supports fork
|
2009-10-25 07:45:34 +00:00
|
|
|
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
|
2011-07-18 21:01:25 +00:00
|
|
|
And I wait 3 seconds
|
2009-10-25 07:45:34 +00:00
|
|
|
And I touch sass/layout.sass
|
|
|
|
And I wait 2 seconds
|
|
|
|
And I shutdown the other process
|
2009-10-25 17:30:13 +00:00
|
|
|
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
|
2009-12-30 18:38:41 +00:00
|
|
|
And the image images/grid.png has a size of 40x24
|
2009-10-25 17:30:13 +00:00
|
|
|
|
|
|
|
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
|
2009-12-30 18:38:41 +00:00
|
|
|
And the image assets/wide_grid.png has a size of 60x24
|
2009-10-25 17:30:13 +00:00
|
|
|
|
|
|
|
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
|
2009-10-26 16:24:38 +00:00
|
|
|
|
|
|
|
Scenario: Generate a compass configuration file
|
2009-11-17 21:47:29 +00:00
|
|
|
Given I should clean up the directory: config
|
2009-10-26 16:24:38 +00:00
|
|
|
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 |
|
|
|
|
|
2010-10-26 00:52:13 +00:00
|
|
|
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 |
|
2010-10-30 22:37:50 +00:00
|
|
|
| foobar | ERROR: configuration property 'foobar' does not exist | with a non-zero error code |
|
2010-10-26 00:52:13 +00:00
|
|
|
|
2010-11-12 05:40:00 +00:00
|
|
|
@validator
|
2009-10-26 16:24:38 +00:00
|
|
|
Scenario: Validate the generated CSS
|
2010-11-28 00:48:36 +00:00
|
|
|
Given I am using the existing project in test/fixtures/stylesheets/valid
|
2009-10-26 16:24:38 +00:00
|
|
|
When I run: compass validate
|
|
|
|
Then my css is validated
|
2009-10-26 16:25:52 +00:00
|
|
|
And I am informed that my css is valid.
|
2009-10-26 16:24:38 +00:00
|
|
|
|
2010-05-30 14:32:58 +00:00
|
|
|
@stats
|
2009-10-26 16:24:38 +00:00
|
|
|
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:
|
2010-08-28 19:50:48 +00:00
|
|
|
| Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties |
|
2010-11-28 00:56:24 +00:00
|
|
|
| sass/border_radius.scss | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/box.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/fonts.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/gradients.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/image_size.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/images.scss | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/layout.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/legacy_clearfix.scss | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/lists.scss | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/print.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/reset.sass | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
|
|
|
| sass/utilities.scss | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
2010-08-28 19:50:48 +00:00
|
|
|
| ------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- |
|
2010-11-28 00:56:24 +00:00
|
|
|
| Total.* | \d+ | \d+ | \d+ | \d+ | \d+ | \d+ |
|
2010-08-28 19:50:48 +00:00
|
|
|
|
2010-05-30 19:37:12 +00:00
|
|
|
@listframeworks
|
2010-05-29 21:57:00 +00:00
|
|
|
Scenario: List frameworks registered with compass
|
|
|
|
When I run: compass frameworks
|
|
|
|
Then I should see the following lines of output:
|
|
|
|
| blueprint |
|
|
|
|
| compass |
|
|
|
|
|