Sha256: bf646f59e663e4666d0e143fd4cf7efd63c50bdab8ef5d08b090053fee60d99b

Contents?: true

Size: 561 Bytes

Versions: 29

Compression:

Stored size: 561 Bytes

Contents

class TestUnitGenerator < RubiGen::Base
  
  attr_reader :name, :test_name, :class_name
  
  def initialize(runtime_args, runtime_options = {})
    super
    usage if args.empty?
    @name           = args.shift
    @test_name      = "test_#{name}".underscore
    @class_name     = name.camelize
  end
  
  def manifest
    record do |m|
      m.directory 'test'

      # Model class, unit test, and fixtures.
      m.template 'test.rb',  "test/#{test_name}.rb"
    end
  end

  protected
    def banner
      "Usage: #{$0} #{spec.name} NameOfTest"
    end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
rubigen-1.5.8 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.5.7 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.5.6 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.5.5 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.5.4 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.5.3 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.0.4 generators/test_unit/test_unit_generator.rb
rubigen-1.0.2 generators/test_unit/test_unit_generator.rb
rubigen-1.0.3 generators/test_unit/test_unit_generator.rb
rubigen-1.0.8 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.1.0 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.2.0 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.0.5 generators/test_unit/test_unit_generator.rb
rubigen-1.3.3 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.3.0 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.0.6 generators/test_unit/test_unit_generator.rb
rubigen-1.2.1 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.2.2 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.2.4 test_unit_generators/test_unit/test_unit_generator.rb
rubigen-1.3.1 test_unit_generators/test_unit/test_unit_generator.rb