Sha256: 2cb7ec5b9dae8496185b9dba82119363fd8bca90aa2563745e50dcc39429dbd9
Contents?: true
Size: 1.24 KB
Versions: 8
Compression:
Stored size: 1.24 KB
Contents
module TestData class VerifiesDumpsAreLoadable def initialize @config = TestData.config @detects_database_emptiness = DetectsDatabaseEmptiness.new end def call(quiet: false) schema_dump_looks_good = Pathname.new(@config.schema_dump_full_path).readable? if !quiet && !schema_dump_looks_good log.warn "Warning: Database schema dump '#{@config.schema_dump_path}' not readable" end data_dump_looks_good = Pathname.new(@config.data_dump_full_path).readable? if !quiet && !data_dump_looks_good log.warn "Warning: Database data dump '#{@config.data_dump_path}' not readable" end non_test_data_dump_looks_good = Pathname.new(@config.non_test_data_dump_full_path).readable? if !quiet && !non_test_data_dump_looks_good log.warn "Warning: Database non-test data dump '#{@config.non_test_data_dump_path}' not readable" end database_empty = @detects_database_emptiness.empty? unless quiet || database_empty log.warn "Warning: Database '#{@config.database_name}' is not empty" end [ schema_dump_looks_good, data_dump_looks_good, non_test_data_dump_looks_good, database_empty ].all? end end end
Version data entries
8 entries across 8 versions & 1 rubygems