Testing Configuration Generator Workflow in PgHero
This test suite validates the configuration generator functionality in PgHero, ensuring proper YAML file generation for database configurations. It verifies that the generator creates the expected configuration structure and file placement within a Rails application.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
ankane/pghero
test/config_generator_test.rb
require_relative "test_helper"
require "generators/pghero/config_generator"
class ConfigGeneratorTest < Rails::Generators::TestCase
tests Pghero::Generators::ConfigGenerator
destination File.expand_path("../tmp", __dir__)
setup :prepare_destination
def test_works
run_generator
assert_file "config/pghero.yml", /databases/
end
end