Sha256: 61841554e95dc9240ced4f0591441f2533c29ae7ba5eb17d9edbc136c1ab3c19
Contents?: true
Size: 1.72 KB
Versions: 1
Compression:
Stored size: 1.72 KB
Contents
require 'yaml' module Shoe module Tasks # Defines <tt>`rake cucumber`</tt> and <tt>`rake cucumber:<PROFILE>`</tt> to # run your Cucumber[http://cukes.info] features. # # <tt>`rake cucumber`</tt> will run features according to the # <tt>default</tt> profile; <tt>`rake cucumber:foo`</tt> according to the # <tt>foo</tt> profile. # # To enable and configure, create and edit your # <tt>{cucumber.yml}[http://wiki.github.com/aslakhellesoy/cucumber/cucumberyml]</tt>. class Cucumber < Abstract def active? !cucumber_profiles.empty? end def define begin require 'cucumber/rake/task' rescue LoadError warn "WARN: Please `gem install cucumber`." else define_tasks end end private def define_tasks cucumber_profiles.each do |profile| if profile == 'default' define_default_task else define_profile_task(profile) end end end def cucumber_profiles YAML.load_file('cucumber.yml').keys rescue [] end def define_default_task namespace :prepare do task :execute end ::Cucumber::Rake::Task.new({ :cucumber => 'prepare:execute' }, 'Run features') do |task| task.profile = 'default' end task :default => :cucumber end def define_profile_task(profile) namespace :prepare do task :execute end namespace :cucumber do ::Cucumber::Rake::Task.new({ profile => 'prepare:execute' }, "Run #{profile} features") do |task| task.profile = profile end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoe-0.6.1 | lib/shoe/tasks/cucumber.rb |