Sha256: 868c92bf4fccbc751ea3e5ada759424df6c760814ada072ae8313463b3c20982

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

require 'thor'

module Cukestart
  module Generator
    class Feature < Thor::Group
      include Thor::Actions
      argument :feature_name, :desc => "Name of the feature"

      def self.source_root
        File.dirname(__FILE__)
      end

      def is_cucumber_project
        if !Dir.exist?("features") or !File.exist?("features/support/env.rb")
          abort("It's not the root of a cucumber project!")
        end
      end

      def create_feature
        template('templates/feature.tt', "features/#{feature_name}.feature")
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cukestart-0.3.0 lib/cukestart/generator/feature.rb
cukestart-0.2.0 lib/cukestart/generator/feature.rb