Sha256: f4d4332f9ad12a39b9e9dd6a87436b9770c8b1b6f89d80bff1179f0d63473594

Contents?: true

Size: 1.2 KB

Versions: 74

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require "rails/generators"
require "rails/generators/testing/behaviour"
require "rails/generators/testing/setup_and_teardown"
require "rails/generators/testing/assertions"
require "fileutils"

module Rails
  module Generators
    # Disable color in output. Easier to debug.
    no_color!

    # This class provides a TestCase for testing generators. To set up, you need
    # just to configure the destination and set which generator is being tested:
    #
    #   class AppGeneratorTest < Rails::Generators::TestCase
    #     tests AppGenerator
    #     destination File.expand_path("../tmp", __dir__)
    #   end
    #
    # If you want to ensure your destination root is clean before running each test,
    # you can set a setup callback:
    #
    #   class AppGeneratorTest < Rails::Generators::TestCase
    #     tests AppGenerator
    #     destination File.expand_path("../tmp", __dir__)
    #     setup :prepare_destination
    #   end
    class TestCase < ActiveSupport::TestCase
      include Rails::Generators::Testing::Behaviour
      include Rails::Generators::Testing::SetupAndTeardown
      include Rails::Generators::Testing::Assertions
      include FileUtils
    end
  end
end

Version data entries

74 entries across 70 versions & 6 rubygems

Version Path
railties-7.0.8.6 lib/rails/generators/test_case.rb
railties-6.1.7.10 lib/rails/generators/test_case.rb
railties-6.1.7.9 lib/rails/generators/test_case.rb
railties-7.0.8.5 lib/rails/generators/test_case.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/railties-7.0.8.4/lib/rails/generators/test_case.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/generators/test_case.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/generators/test_case.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/generators/test_case.rb
railties-7.0.8.4 lib/rails/generators/test_case.rb
railties-6.1.7.8 lib/rails/generators/test_case.rb
railties-7.0.8.1 lib/rails/generators/test_case.rb
railties-6.1.7.7 lib/rails/generators/test_case.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/generators/test_case.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/generators/test_case.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/generators/test_case.rb
railties-7.0.8 lib/rails/generators/test_case.rb
railties-7.0.7.2 lib/rails/generators/test_case.rb
railties-6.1.7.6 lib/rails/generators/test_case.rb
railties-7.0.7.1 lib/rails/generators/test_case.rb
railties-6.1.7.5 lib/rails/generators/test_case.rb