Sha256: 19f65da26974c0b9d0c54a28950577fcc4f10afe4a7a069bd78e4354e76b5707

Contents?: true

Size: 605 Bytes

Versions: 27

Compression:

Stored size: 605 Bytes

Contents

require 'generators/rspec'

module Rspec
  module Generators
    class ViewGenerator < Base
      argument :actions, :type => :array, :default => [], :banner => "action action"

      class_option :template_engine, :desc => "Template engine to generate view files"

      def create_view_files
        empty_directory File.join("spec", "views", file_path)

        actions.each do |action|
          @action = action
          template 'view_spec.rb',
                   File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rspec-rails-2.0.0 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.rc lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.22 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.20 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.19 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.18 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.17 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.16 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.15 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.14.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.14.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.13 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.12 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.11 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.10 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.9.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.8 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.7 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.6 lib/generators/rspec/view/view_generator.rb
rspec-rails-2.0.0.beta.5 lib/generators/rspec/view/view_generator.rb