File: spec_helper.rb

package info (click to toggle)
ruby-heapy 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 97,184 kB
  • sloc: ruby: 394; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 397 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'heapy'

require 'pathname'
require "open3"
require 'tempfile'

def fixtures(name)
  Pathname.new(File.expand_path("../fixtures", __FILE__)).join(name)
end


def run(cmd)
  out = ""
  Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
    err = stderr.read
    raise err unless err.empty?
    out = stdout.read
  end
  out
end