Class: SavedAssetTest

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/saved_assets.rb

Instance Method Summary collapse

Instance Method Details

#test_script_name_with_special_characters_in_blocknameObject



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/saved_assets.rb', line 40

def test_script_name_with_special_characters_in_blockname
  filename = 'sample.txt'
  prefix = 'test'
  time = Time.new(2023, 1, 1, 12, 0, 0)
  blockname = 'block/1:2'

  expected_name = 'test_2023-01-01-12-00-00_sample.txt_,_block_1_2.sh'
  assert_equal expected_name, MarkdownExec::SavedAsset.script_name(
    filename: filename, prefix: prefix, time: time, blockname: blockname
  )
end

#test_stdout_name_with_special_characters_in_blocknameObject



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/saved_assets.rb', line 52

def test_stdout_name_with_special_characters_in_blockname
  filename = 'sample.txt'
  prefix = 'test'
  time = Time.new(2023, 1, 1, 12, 0, 0)
  blockname = 'block/1:2'

  expected_name = 'test_2023-01-01-12-00-00_sample.txt_,_block_1_2.out.txt'
  assert_equal expected_name, MarkdownExec::SavedAsset.stdout_name(
    filename: filename, prefix: prefix, time: time, blockname: blockname
  )
end