Forked from josephwilk/Lazy script for grepping step defintions in cucumber
Created
February 28, 2009 12:53
-
-
Save edbond/71947 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'trollop' | |
config = {:step_type => 'Given,When,Then'} | |
opts = Trollop.options do | |
opt :step_type, "Given, When or Then", :type => :string, :default => config[:step_type] | |
end | |
term = ARGV.last | |
regexp_step_types = opts[:step_type].split(',').join('|') | |
FEATURE_DIR = 'features/step_definitions' | |
result = system "egrep -rih '^\s*(#{regexp_step_types}).*#{term}' #{FEATURE_DIR}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment