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-4.0.0.rc1 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta6 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta5 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta4 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta3 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta2 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-4.0.0.beta1 lib/rails/generators/test_unit/cell/cell_generator.rb
cells-jamie-4.0.0.alpha1 lib/rails/generators/test_unit/cell/cell_generator.rb