Sha256: 7416c51fb975d327c831b2823aa78f8476aec4e092d95bb91e39f14076a4b488

Contents?: true

Size: 702 Bytes

Versions: 195

Compression:

Stored size: 702 Bytes

Contents

require 'rails/generators/test_unit'

module TestUnit
  module Generators
    class ModelGenerator < Base
      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
      class_option :fixture, :type => :boolean

      check_class_collision :suffix => "Test"

      def create_test_file
        template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
      end

      hook_for :fixture_replacement

      def create_fixture_file
        if options[:fixture] && options[:fixture_replacement].nil?
          template 'fixtures.yml', File.join('test/fixtures', class_path, "#{plural_file_name}.yml")
        end
      end
    end
  end
end

Version data entries

195 entries across 159 versions & 17 rubygems

Version Path
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
font-awesome-rails-3.1.1.2 vendor/ruby/2.0.0/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
font-awesome-rails-3.1.1.1 vendor/ruby/2.0.0/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
challah-1.0.0.beta vendor/bundle/gems/railties-3.2.11/lib/rails/generators/test_unit/model/model_generator.rb
railties-3.1.12 lib/rails/generators/test_unit/model/model_generator.rb
openskies-0.0.5.2 lib/rails/generators/test_unit/model/model_generator.rb
openskies-0.0.5.1 lib/rails/generators/test_unit/model/model_generator.rb
openskies-0.0.5 lib/rails/generators/test_unit/model/model_generator.rb
openskies-0.0.4 lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
openskies-0.0.3 lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/generators/test_unit/model/model_generator.rb