Sha256: 1d4167230f78ffd3912d73d14cb962578008667f19027936ace90e74116f00b6

Contents?: true

Size: 1.54 KB

Versions: 5

Compression:

Stored size: 1.54 KB

Contents

@disable-bundler
Feature: reusable views generator

  Background:
    Given a directory named "testengine"
    When I cd to "testengine"
    And I write to "testengine.gemspec" with:
    """
    Gem::Specification.new do |s|
      s.name         = %q{testengine}
      s.version      = '1.0'
      s.files        = Dir['**/*']
      s.require_path = 'lib'
      s.add_dependency 'diesel'
    end
    """
    When I write to "app/views/examples/index.html.erb" with:
    """
    Hello there
    """
    When I write to "lib/testengine.rb" with:
    """
    require 'rails'
    module Testengine
      class Engine < Rails::Engine
      end
    end
    """
    When I write to "lib/generators/testengine/views/views_generator.rb" with:
    """
    require 'diesel/generators/views_base'

    module Testengine
      module Generators
        class ViewsGenerator < Diesel::Generators::ViewsBase
        end
      end
    end
    """
    When I cd to ".."
    And I successfully run "rails new testapp"
    And I cd to "testapp"
    And I add the "testengine" as a diesel engine
    And I run "bundle install --local"

  Scenario: copy views into an app from a diesel engine
    When I successfully run "rails generate testengine:views --trace"
    Then the file "app/views/examples/index.html.erb" should contain "Hello there"

  Scenario: view generator descriptions from an app with a diesel engine
    When I successfully run "rails generate testengine:views -h"
    Then the output should contain:
    """
    Copy view files for the engine into your application.
    """


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
diesel-0.1.4 features/views_generator.feature
diesel-0.1.3 features/views_generator.feature
diesel-0.1.2 features/views_generator.feature
diesel-0.1.1 features/views_generator.feature
diesel-0.1.0 features/views_generator.feature