diff --git a/Rakefile b/Rakefile index ab1a25ab..19cf2327 100644 --- a/Rakefile +++ b/Rakefile @@ -106,8 +106,8 @@ end desc('Generate many sample data for snapshot tests') task(:update_fixed_examples) do - sh('rm ./test/many_data/fixtures/dumped_fixed_examples_*.bin') - ruby('./scripts/generate_many_examples.rb') + sh('rm ./test/many_data/fixtures/snapshots_*.bin') + ruby('./scripts/generate_snapshots.rb') end desc('To prevent #69 anymore!') diff --git a/scripts/convert_snapshot_dump_to_toml.rb b/scripts/convert_snapshot_dump_to_toml.rb index 84bad6fc..7bd2e44b 100644 --- a/scripts/convert_snapshot_dump_to_toml.rb +++ b/scripts/convert_snapshot_dump_to_toml.rb @@ -7,7 +7,7 @@ require('perfect_toml') -path_prefix = "#{__dir__}/../test/many_data/fixtures/dumped_fixed_examples_" +path_prefix = "#{__dir__}/../test/many_data/fixtures/snapshots_" timestamp = '2024-01-10_07-59' without_ext = "#{path_prefix}#{timestamp}" dump_data = File.binread("#{without_ext}.bin") diff --git a/scripts/generate_many_examples.rb b/scripts/generate_snapshots.rb similarity index 96% rename from scripts/generate_many_examples.rb rename to scripts/generate_snapshots.rb index 5511003b..5043d9de 100644 --- a/scripts/generate_many_examples.rb +++ b/scripts/generate_snapshots.rb @@ -57,7 +57,7 @@ puts('The generated samples are below') p(examples.sample(20)) -filename = "dumped_fixed_examples_#{Time.now.strftime('%Y-%m-%d_%H-%M')}.bin" +filename = "snapshots_#{Time.now.strftime('%Y-%m-%d_%H-%M')}.bin" output_path = "#{File.expand_path('.')}/test/many_data/fixtures/#{filename}" File.open(output_path, 'w+b') do |file| diff --git a/test/many_data/fixtures/dumped_fixed_examples_2024-01-10_07-59.bin b/test/many_data/fixtures/snapshots_2024-01-10_07-59.bin similarity index 100% rename from test/many_data/fixtures/dumped_fixed_examples_2024-01-10_07-59.bin rename to test/many_data/fixtures/snapshots_2024-01-10_07-59.bin diff --git a/test/many_data/fixtures/dumped_fixed_examples_2024-01-10_07-59.toml b/test/many_data/fixtures/snapshots_2024-01-10_07-59.toml similarity index 100% rename from test/many_data/fixtures/dumped_fixed_examples_2024-01-10_07-59.toml rename to test/many_data/fixtures/snapshots_2024-01-10_07-59.toml diff --git a/test/many_data/test_fixed_many_data.rb b/test/many_data/test_snapshots.rb similarity index 94% rename from test/many_data/test_fixed_many_data.rb rename to test/many_data/test_snapshots.rb index d2665522..8496462b 100644 --- a/test/many_data/test_fixed_many_data.rb +++ b/test/many_data/test_snapshots.rb @@ -5,8 +5,8 @@ require_relative('fixtures/example') # https://github.com/kachick/ruby-ulid/issues/89 -class TestFixedManyData < Test::Unit::TestCase - dump_data = File.binread("#{__dir__}/fixtures/dumped_fixed_examples_2024-01-10_07-59.bin") +class TestSnapshots < Test::Unit::TestCase + dump_data = File.binread("#{__dir__}/fixtures/snapshots_2024-01-10_07-59.bin") EXAMPLES = Marshal.load(dump_data) def assert_example(ulid, example)