test/samples.rb in ipfs-api-0.1.0 vs test/samples.rb in ipfs-api-0.2.0

- old
+ new

@@ -2,10 +2,12 @@ require 'test/common' require 'ipfs-api/upload' module Samples + TEMP_DIR_PREFIX = 'ruby-ipfs-api-unit-test-' + include IPFS def some_virtual_folders fixture = [ Upload.folder('a1') { |a1| @@ -59,11 +61,11 @@ yield fixture, expectation end module_function :some_virtual_folders def some_filesystem_folders - Dir.mktmpdir('ruby-ipfs-api-unit-test-') do |root| + Dir.mktmpdir(TEMP_DIR_PREFIX) do |root| a1 = File.join(root, 'a1') Dir.mkdir(a1, 0755) b1 = File.join(a1, 'b1') Dir.mkdir(b1, 0755) hello = File.join(b1, 'hello.txt') @@ -78,7 +80,13 @@ } yield fixture, expectation end end module_function :some_filesystem_folders + + def some_byte_sequences + s = ('a'..'z').to_a.join + [ s ] * 17 + end + module_function :some_byte_sequences end