Class: Quails::Generators::TestCase

Inherits:
ActiveSupport::TestCase show all
Includes:
FileUtils, Quails::Generators::Testing::Assertions, Quails::Generators::Testing::Behaviour, Quails::Generators::Testing::SetupAndTeardown
Defined in:
railties/lib/rails/generators/test_case.rb

Overview

This class provides a TestCase for testing generators. To setup, you need just to configure the destination and set which generator is being tested:

class AppGeneratorTest < Quails::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 < Quails::Generators::TestCase
  tests AppGenerator
  destination File.expand_path("../tmp", __dir__)
  setup :prepare_destination
end

Constant Summary

Constants inherited from ActiveSupport::TestCase

ActiveSupport::TestCase::Assertion

Constants included from ActiveSupport::Testing::Assertions

ActiveSupport::Testing::Assertions::UNTRACKED

Method Summary

Methods included from Quails::Generators::Testing::Assertions

#assert_class_method, #assert_field_default_value, #assert_field_type, #assert_file, #assert_instance_method, #assert_migration, #assert_no_file, #assert_no_migration

Methods included from Quails::Generators::Testing::SetupAndTeardown

#setup, #teardown

Methods included from Quails::Generators::Testing::Behaviour

#create_generated_attribute, #generator, #run_generator

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included

Methods inherited from ActiveSupport::TestCase

test_order, test_order=

Methods included from ActiveSupport::Testing::Declarative

#test

Methods included from ActiveRecord::TestFixtures

#after_teardown, #before_setup, #enlist_fixture_connections, #run_in_transaction?, #setup_fixtures, #teardown_fixtures

Methods included from ActiveSupport::Testing::FileFixtures

#file_fixture

Methods included from ActiveSupport::Testing::TimeHelpers

#after_teardown, #freeze_time, #travel, #travel_back, #travel_to

Methods included from ActiveSupport::Testing::Deprecation

#assert_deprecated, #assert_not_deprecated, #collect_deprecations

Methods included from ActiveSupport::Testing::Assertions

#assert_changes, #assert_difference, #assert_no_changes, #assert_no_difference, #assert_not, #assert_nothing_raised

Methods included from ActiveSupport::Testing::SetupAndTeardown

#after_teardown, #before_setup

Methods included from ActiveSupport::Testing::TaggedLogging

#before_setup