Sha256: 74dfb69154afb267ef9382309a4fcef2e8f74dcf036389bbbf1354f3ea37b99d

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

require 'thor/group'
require 'git'
require 'active_support/inflector'

module WatirInstall
  module Generators
    class Test < Thor::Group
      include Thor::Actions

      argument :klass, type: :string, desc: 'The data object being created'
      argument :form, type: :string, default: '', desc: 'Generates #submit_form'
      argument :specs, required: false, default: [], type: :array, desc: 'Specs for'

      def self.source_root
        "#{File.dirname(__FILE__)}/tests"
      end

      def name
        Dir.pwd[/[^\/]*$/]
      end

      def data_files
        if form == 'true'
          template "spec/crud.rb.tt", "#{Dir.pwd}/spec/#{klass.downcase}_spec.rb"
        else
          template "spec/spec.rb.tt", "#{Dir.pwd}/spec/#{klass.downcase}_spec.rb"
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir_install-0.3.0 lib/watir_install/generators/test.rb