middleman/middleman-cli/features/cli_init.feature

94 lines
3.3 KiB
Gherkin
Raw Normal View History

Feature: Middleman CLI
Scenario: Create a new project
2015-01-04 22:23:37 +01:00
When I run `middleman init MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then the exit status should be 0
2011-12-16 07:11:59 +01:00
When I cd to "MY_PROJECT"
Then the following files should exist:
| Gemfile |
| .gitignore |
2011-12-16 07:11:59 +01:00
| config.rb |
| source/index.html.erb |
| source/layouts/layout.erb |
| source/javascripts/all.js |
2015-01-04 22:06:14 +01:00
| source/stylesheets/site.css.scss |
| source/stylesheets/_normalize.scss |
Scenario: Create a new project in the current directory
Given a directory named "MY_PROJECT"
When I cd to "MY_PROJECT"
2015-01-04 22:28:13 +01:00
And I run `middleman init` interactively
2015-01-04 22:23:37 +01:00
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then the exit status should be 0
And the following files should exist:
| Gemfile |
| config.rb |
| source/index.html.erb |
2011-12-21 21:13:28 +01:00
Scenario: Create a new project (alias i)
2015-01-04 22:23:37 +01:00
When I run `middleman i MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
2011-12-21 21:13:28 +01:00
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias new)
2015-01-04 22:23:37 +01:00
When I run `middleman new MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
2011-12-21 21:13:28 +01:00
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias n)
2015-01-04 22:23:37 +01:00
When I run `middleman n MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
2011-12-21 21:13:28 +01:00
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project using Middleman directory
When I run `middleman init MY_PROJECT -T blog`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
And the file "Gemfile" should contain "middleman-blog"
And the file ".gitignore" should exist
Scenario: Create an invalid project using Middleman directory
When I run `middleman init MY_PROJECT -T does-not-exist-for-reals`
2016-01-19 23:55:47 +01:00
Then the exit status should be 1
Scenario: Create a new project using github(user/repository)
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project using github(user/repository#branch)
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default#master` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
And the output should contain "-b master"
Scenario: Create a new project using full path(://)
When I run `middleman init MY_PROJECT -T https://github.com/middleman/middleman-templates-default.git` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist