Sha256: d280557f79095406bfa0796a66f01cf077618388c19a5edfd50a7f57df7ed0d5

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

require 'tempfile'

RSpec.configure do |c|
  c.include(Module.new do

    def range_to_file range
      file = Tempfile.new("test-#{range}")
      file.write(range.to_a.join("\n"))
      file.flush
      file.seek(0)
      file
    end

    def string_to_file string
      file = Tempfile.new("test-string")
      file.write(string)
      file.flush
      file.seek(0)
      file
    end

    def log2 n
      Math.log(n) / Math.log(2)
    end

  end)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
log_slice-0.1 spec/helper.rb