Skip to content

Commit

Permalink
Check if default shells used in tests are installed on developer pc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Günnewig committed Jan 4, 2016
1 parent 37bfccd commit 3b293ef
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 24 deletions.
86 changes: 62 additions & 24 deletions features/steps/command/shell.feature
@@ -1,15 +1,17 @@
Feature: Running shell commands

You can run an *ad hoc* script with the following step
You can run an *ad hoc* script with the following steps:
- `When I run the following script:`

Or you can run shell commands with:
- `I run the following (bash|zsh|fish|dash)? commands`
- `I run the following (bash|zsh|...shell)? commands`
- `I run the following (bash|zsh|...shell)? commands (in|with) \`interpreter\``
- `I run the following (bash|zsh|...shell)? commands (in|with) \`/path/to/interpreter\``

Background:
Given I use a fixture named "cli-app"

Scenario: Running ruby script
Scenario: Creating and running scripts
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Expand All @@ -21,14 +23,7 @@ Feature: Running shell commands
puts "Hello"
\"\"\"
Then the output should contain exactly "Hello"
"""
When I run `cucumber`
Then the features should all pass
Scenario: Running python script
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running python script
When I run the following script:
\"\"\"bash
Expand Down Expand Up @@ -75,43 +70,86 @@ Feature: Running shell commands
"""
Feature: Running zsh scripts
Scenario: Running zsh commands
When I run the following commands in `zsh`:
When I run the following commands with `zsh`:
\"\"\"bash
echo "Hello \c"
echo $((2 + 2))
\"\"\"
Then the output should contain exactly "Hello 4"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running zsh commands
Scenario: Running ruby commands
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running ruby commands
When I run the following commands with `ruby`:
\"\"\"ruby
puts "Hello, Aruba!"
\"\"\"
Then the output should contain exactly "Hello, Aruba!"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running python commands
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running ruby commands
When I run the following commands with `python`:
\"\"\"ruby
print("Hello, Aruba!")
\"\"\"
Then the output should contain exactly "Hello, Aruba!"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running commands if full path to interpreter is given
Given a file named "features/shell.feature" with:
"""
Feature: Running full path zsh
Scenario: Running zsh commands #1
When I run the following commands with `/bin/zsh`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello 4"
Scenario: Running zsh commands #1
When I run the following commands in `/bin/zsh`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello 4"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running fish commands
Scenario: Running commands if only the name of interpreter is given
Given a file named "features/shell.feature" with:
"""
Feature: Running fish scripts
Scenario: Running fish commands
When I run the following commands in `fish`:
Feature: Running full path zsh
Scenario: Running zsh commands #1
When I run the following commands with `zsh`:
\"\"\"bash
echo -n "Hello "
echo (echo fish)
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello fish"
Then the output should contain exactly "Hello 4"
Scenario: Running fish commands with explicit path
When I run the following commands with `/usr/bin/env fish`:
Scenario: Running zsh commands #2
When I run the following commands in `zsh`:
\"\"\"bash
echo -n "Hello "
echo (echo fish)
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello fish"
Then the output should contain exactly "Hello 4"
"""
When I run `cucumber`
Then the features should all pass
8 changes: 8 additions & 0 deletions script/bootstrap
Expand Up @@ -13,6 +13,14 @@ echo -ne "$info_msg Checking if ruby installed? "
which 'ruby' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`ruby\`. Please install ruby or add it to PATH"; output_error_log; exit 1 )
echo OK

echo -ne "$info_msg Checking if bash installed? "
which 'bash' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`bash\`. Please install bash or add it to PATH"; output_error_log; exit 1 )
echo OK

echo -ne "$info_msg Checking if zsh installed? "
which 'zsh' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`zsh\`. Please install zsh or add it to PATH"; output_error_log; exit 1 )
echo OK

echo -e "$info_msg rubygem \"bundler\" "
gem install bundler

Expand Down

0 comments on commit 3b293ef

Please sign in to comment.