Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c34b1fc18b
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (29 sloc) 1.164 kb
module Merb::Generators
class CucumberFeatureGenerator < NamedGenerator
desc <<-DESC
Generates cucumber feature files
DESC
def self.source_root
File.join(File.dirname(__FILE__), 'feature', 'templates')
end
def underscored_file_name(name)
name.gsub(/\s+/, "_")
end
first_argument :name, :required => true
option :goal, :desc => 'Goal used in the story: To [tighten the feedback loop, protect the revenue, ...]',
:as => :string, :default => "[accomplish some goal]"
option :role, :desc => 'Role used in the story: A [subscriber, account administrator, ...]',
:as => :string, :default => "[role]"
option :steps, :desc => "Also generate a steps file",
:as => :boolean, :default => false
template :feature do |t|
t.source = "feature.rbt"
t.destination = "features/#{underscored_file_name(name)}.feature"
end
file :steps, :steps => true do |t|
t.source = "feature_steps.rb"
t.destination = "features/steps/#{underscored_file_name(name)}_steps.rb"
end
end
add :feature, CucumberFeatureGenerator
end
Jump to Line
Something went wrong with that request. Please try again.