Sha256: 8a60579269eb8d0f15b0e67629e2229cc54c50b7b41cbb250e9cd0a420c83df5

Contents?: true

Size: 932 Bytes

Versions: 2

Compression:

Stored size: 932 Bytes

Contents

#!/usr/bin/env ruby

# note that report of assertions count is
# zero. Probably because we are doing assert in
# workspace rather than Test

require File.dirname(__FILE__) + '/../lib/rubish'
require 'rubygems'
require 'test/unit'
gem 'thoughtbot-shoulda'
require 'shoulda'

TEST_DIR = File.expand_path(File.dirname(__FILE__)) + "/tmp"

Rubish.new_session
WS = Rubish.session.current_workspace
WS.extend Test::Unit::Assertions

def setup_tmp
  WS.eval {
    rm(:rf, TEST_DIR).exec if File.exist?(TEST_DIR)
    mkdir(TEST_DIR).exec
    cd TEST_DIR
  }
end

setup_tmp

TUT = Test::Unit::TestCase


class Rubish::Test < TUT
  def setup
    setup_tmp
  end

  module Helper
    class << self
      def created_ios
        set1 = Set.new
        set2 = Set.new
        ObjectSpace.each_object(IO) { |o| set1 << o }
        yield
        ObjectSpace.each_object(IO) { |o| set2 << o }
        set2 - set1).to
      end
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubish-0.1.0 test/test_dev.rb
rubish-0.0.1 test/test_dev.rb