compass/features/command_line.feature

174 lines
8.8 KiB
Gherkin
Raw Normal View History

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
Then a directory my_project/ is created
And a configuration file my_project/config.rb is created
And a sass file my_project/src/screen.sass is created
And a sass file my_project/src/print.sass is created
And a sass file my_project/src/ie.sass is created
And a sass file my_project/src/screen.sass is compiled
And a sass file my_project/src/print.sass is compiled
And a sass file my_project/src/ie.sass is compiled
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
And a sass file bp_project/src/screen.sass is created
And a sass file bp_project/src/print.sass is created
And a sass file bp_project/src/ie.sass is created
And a sass file bp_project/src/screen.sass is compiled
And a sass file bp_project/src/print.sass is compiled
And a sass file bp_project/src/ie.sass is compiled
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
And a sass file custom_project/sass/screen.sass 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
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
And a sass file my_project/src/screen.sass is reported created
And a sass file my_project/src/print.sass is reported created
And a sass file my_project/src/ie.sass 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
2009-10-24 22:21:49 +00:00
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/src/ 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 src subdirectory
And I am told how to compile my sass stylesheets
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
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
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 sass file sass/layout.sass is reported compiled
And a sass file sass/print.sass is reported compiled
And a sass file sass/reset.sass is reported compiled
And a sass file sass/utilities.sass is reported compiled
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 sass file tmp_compass/sass/layout.sass is reported compiled
And a sass file tmp_compass/sass/print.sass is reported compiled
And a sass file tmp_compass/sass/reset.sass is reported compiled
And a sass file tmp_compass/sass/utilities.sass is reported compiled
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: 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
Then a sass file sass/layout.sass is reported unchanged
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
2009-10-25 00:46:59 +00:00
Scenario: Basic help
When I run: compass help
Then I should be shown a list of available commands
And the list of commands should describe the compile command
And the list of commands should describe the create command
And the list of commands should describe the grid-img command
And the list of commands should describe the help command
And the list of commands should describe the init command
And the list of commands should describe the install command
And the list of commands should describe the version command
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 sass file sass/layout.sass is reported compiled
Then a css file tmp/layout.css is reported identical
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
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
Then a sass file sass/layout.sass is reported compiled
And a css file tmp/layout.css is reported overwritten
And a sass file sass/print.sass is reported unchanged
And a sass file sass/reset.sass is reported unchanged
And a sass file sass/utilities.sass is reported unchanged
Scenario: Watching a project for changes
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 1 second
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
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
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