Skip to content

Instantly share code, notes, and snippets.

@dazza-codes
Forked from jasoares/cucumber_init.sh
Last active August 29, 2015 14:09
Show Gist options
  • Save dazza-codes/df18810307c27dc9d375 to your computer and use it in GitHub Desktop.
Save dazza-codes/df18810307c27dc9d375 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Create the directory structure
mkdir -p features/step_definitions
mkdir -p features/support
# Create a placeholder for the step_definitions folder
touch features/step_definitions/"$(basename `pwd`)_steps.rb"
# Create the environment file
echo '$: << File.expand_path("../../lib", File.dirname(__FILE__))' > features/support/env.rb
echo "require '$(basename `pwd`)'" >> features/support/env.rb
# Generate sample feature
cat > features/sample.feature <<EOS
Feature: Sample Feature
Scenario: Sample Scenario
Given the world
When your wishes come true
Then you are happy
EOS
# Give user some output
echo "Cucumber file structure created successfully."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment