Sha256: 1661a5f5583508335cb7cc92551f65b2881fc80accaf17c383f35b83f3ac59b5

Contents?: true

Size: 529 Bytes

Versions: 28

Compression:

Stored size: 529 Bytes

Contents

require 'rails/generators/test_unit'

module TestUnit # :nodoc:
  module Generators # :nodoc:
    class CellGenerator < Base # :nodoc:
      source_root File.expand_path('../templates', __FILE__)
      argument :actions, type: :array, default: []
      check_class_collision suffix: 'CellTest'

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

      private

      def states
        (['show'] + actions).uniq
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
cells-rails-0.1.6 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.5 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.4 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.3 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.2 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.1 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.1.0 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.9 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.8 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.7 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.6 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.5 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.4 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-rails-0.0.3 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.5 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.4 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.3 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.2 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.1 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0 lib/rails/generators/test_unit/cell/cell_generator.rb