-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic acceptance tests: show and init
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Guard "init" command | ||
|
||
In order to quickly start a new project with Guard | ||
As a user | ||
I want Guard to create a Guardfile template for me | ||
|
||
Scenario: Create an empty Guardfile | ||
When I run `guard init -b` | ||
Then the output should match /Writing new Guardfile to .*Guardfile$/ | ||
And the file "Guardfile" should contain "# A sample Guardfile" | ||
|
||
Scenario: Create a Guardfile using a plugin's template | ||
When I run `guard init ronn` | ||
Then the output should match /Writing new Guardfile to .*Guardfile$/ | ||
And the file "Guardfile" should match /^guard :ronn do$/ |
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,26 @@ | ||
Feature: Show | ||
|
||
In order to know the defined groups and plugins | ||
As a developer using Guard | ||
I want to see a table of groups and plugins | ||
|
||
Scenario: Show error when no Guardfile | ||
When I run `guard show` | ||
Then the output should match /No Guardfile found, please create one with `guard init`\./ | ||
And the exit status should not be 0 | ||
|
||
Scenario: Show error when Guardfile has no plugins | ||
Given an empty file named "Guardfile" | ||
When I run `guard show` | ||
Then the output should match /No Guard plugins found in Guardfile, please add at least one\.$/ | ||
# TODO: this step fails | ||
# And the exit status should not be 0 | ||
|
||
Scenario: Show plugins and their configuration | ||
Given a file named "Guardfile" with: | ||
""" | ||
guard :ronn do | ||
end | ||
""" | ||
When I run `guard show` | ||
Then the output should match /^| Default | Ronn\s+ |/ |
41d540d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's really cool!
41d540d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, it would use custom steps, such as "Given a Guardfile with:" and "It should fail with "no plugins found" error" (which would map to the right expected message).
But... I've got my hands full with scopes and cleanup :(