File: spec_helper.rb

package info (click to toggle)
libdataobjects-ruby 0.10.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 336 kB
  • ctags: 200
  • sloc: ruby: 2,729; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 792 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
22
23
24
25
26
27
28
29
30
require 'rubygems'
require 'data_objects'
require 'data_objects/spec/bacon'
require 'mocha/api'
require 'mocha/object'
require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/

module DataObjects::Pooling
  class << self
    remove_method :scavenger_interval if instance_methods(false).any? { |m| m.to_sym == :scavenger_interval }
    def scavenger_interval
      0.5
    end
  end
end

# see http://gnufied.org/2008/06/12/making-ruby-bacon-play-with-mocha/
class Bacon::Context
  include Mocha::API
  alias_method :old_it,:it
  def it description,&block
    mocha_setup
    old_it(description,&block)
    mocha_verify
    mocha_teardown
  end
end

require File.expand_path(File.join(File.dirname(__FILE__), 'do_mock'))
require File.expand_path(File.join(File.dirname(__FILE__), 'do_mock2'))