Skip to content

Commit

Permalink
Fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
monkbroc committed Mar 7, 2018
1 parent 9d08673 commit 98b50b1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 29 deletions.
8 changes: 1 addition & 7 deletions accept/features/help.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Feature: help and default command
And stdout should not contain "Error"
And the output should show the help page

Scenario: Running the CLI with "help"
Given I run particle "help"
Then stderr should not contain "Error"
And the output should show the help page
And the output should not contain "echo"

Scenario: Running the CLI with "help"
Given I run particle "help"
Then stderr should not contain "Error"
Expand All @@ -23,6 +17,6 @@ Feature: help and default command
Scenario: Running the CLI with "--help"
Given I run particle "--help"
Then stderr should not contain "Error"
And the output should show the new help page
And the output should show the help page


8 changes: 4 additions & 4 deletions accept/features/library.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Feature: library

Scenario: when the user doesn't specify a subcommand the container command help is shown
When I run particle "library"
Then the output should contain "Usage: library <command>"
And the output should contain "Creates a new library"
Then the output should contain "Usage: particle library <command>"
And the output should contain "Create a new library"

Scenario: the library help is listed
When I run particle "help library"
Then the output should contain "The following commands are available:"
Then the output should contain "Usage: particle library <command>"


2 changes: 1 addition & 1 deletion accept/features/library_add.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: library add

Scenario: a user may get help when running particle library add with no additinoal parameters
When I run particle "library add"
Then the output should contain "Usage: library add [options] <name>"
Then the output should contain "Usage: particle library add [options] <name>"
# todo - also show command description "Add a library to a project"??

Scenario: adding a library to a library project
Expand Down
20 changes: 3 additions & 17 deletions accept/features/step_definitions/particle-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,12 @@
end

And(/^the (stderr|stdout|output) should show the help page$/) do |out|
step "the #{out} should show the old help page"
end

And(/^the (stderr|stdout|output) should show the old help page$/) do |out|
step "the #{out} should contain \"Usage: particle <command_name> <arguments>\""
step "the #{out} should contain \"Common Commands:\""
step "the #{out} should contain \"library\""
step "the #{out} should contain \"help\""
step "the #{out} should contain \"setup\""
step "the #{out} should contain \"device\""
end

And(/^the (stderr|stdout|output) should show the new help page$/) do |out|
step "the #{out} should contain \"Welcome to the Particle Command Line Interface\""
step "the #{out} should contain \"Usage: particle <command>\""
step "the #{out} should contain \"Commands:\""
step "the #{out} should contain \"help\""
step "the #{out} should contain \"library\""
step "the #{out} should contain \"Usage: <command>\""
step "the #{out} should contain \"Options\""
step "the #{out} should contain \"--verbose\""
step "the #{out} should match exactly once /help\\s+Provides extra details and options for a given command/"
end


Expand Down Expand Up @@ -132,4 +118,4 @@
And(/^I respond to the prompt "([^"]*)" with environment variable "([^"]*)"$/) do |prompt, envvar|
response = ENV[envvar]
step "I respond to the prompt \"#{prompt}\" with \"#{response}\""
end
end

0 comments on commit 98b50b1

Please sign in to comment.