Sha256: 7aaececc06a5ab64a55a862592c655a249cf05d93a5eb497213e726abfc9f3d7

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

Feature: Prompt the user for information with My scripts

As a user of the My gem
I want to optionally run tasks
So that I can be explicit

Scenario: Accepting a prompt
Given a file named "yes.txt.template" with:
  """
  The user picked yes
  """
And a file named "script.rb" with:
  """
  ask "Would you like to add a file?"
  yes do
    file "yes.txt" => "yes.txt.template"
  end
  """
When I run "../../bin/my script.rb" interactively
Then the program should prompt "Would you like to add a file? [y/N]"

When I type "y"
And the program completes
Then the file "yes.txt" should contain "The user picked yes"

Scenario: Declining a prompt
Given a file named "no.txt.template" with:
  """
  The user picked no
  """
And a file named "script.rb" with:
  """
  ask "Would you like to add a file?"
  no do
    file "no.txt"  => "no.txt.template"
  end
  """
When I run "../../bin/my script.rb" interactively
Then the program should prompt "Would you like to add a file? [y/N]"

When I type "n"
And the program completes
Then the file "no.txt" should contain "The user picked no"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
my-0.3.0 features/questions.feature