Sha256: d629f3ba5c1e8c969c1ac608227937434f1f6029ef1226107964de0079941ffb

Contents?: true

Size: 521 Bytes

Versions: 6

Compression:

Stored size: 521 Bytes

Contents

module TestUnit
  module Generators
    class ClassyEnumGenerator < Rails::Generators::NamedBase
      desc "Generate a ClassyEnum test in test/enums/"

      argument :name, :type => :string, :required => true, :banner => 'EnumName'
      argument :values, :type => :array, :default => [], :banner => 'value1 value2 value3 etc...'

      source_root File.expand_path("../templates", __FILE__)

      def copy_files # :nodoc:
        template "enum_test.rb", "test/enums/#{file_name}_test.rb"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
classy_enum-3.5.0 lib/generators/test_unit/classy_enum_generator.rb
classy_enum-3.5.0.beta2 lib/generators/test_unit/classy_enum_generator.rb
classy_enum-3.5.0.beta lib/generators/test_unit/classy_enum_generator.rb
classy_enum-3.4.0 lib/generators/test_unit/classy_enum_generator.rb
classy_enum-3.4.0.beta1 lib/generators/test_unit/classy_enum_generator.rb
classy_enum-3.3.2 lib/generators/test_unit/classy_enum_generator.rb