Skip to content

Commit

Permalink
Rename with the purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Mar 20, 2024
1 parent 31d4c3d commit 55a5c11
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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!')
Expand Down
2 changes: 1 addition & 1 deletion scripts/convert_snapshot_dump_to_toml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 55a5c11

Please sign in to comment.