Sha256: 03f32b8a5381abc8a9d2a117a77240587acf9141423faa8ba546395e2d460498

Contents?: true

Size: 909 Bytes

Versions: 14

Compression:

Stored size: 909 Bytes

Contents

#--
# (c) Copyright 2007-2008 Sun Microsystems, Inc.
# See the file LICENSES.txt included with the distribution for
# software license details.
#++

require 'rubygems'
require 'spec'

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'warbler'

raise %{Error: detected running Warbler specs in a Rails app;
Warbler specs are destructive to application directories.} if File.directory?("app")

def silence(io = nil)
  require 'stringio'
  old_stdout = $stdout
  old_stderr = $stderr
  $stdout = io || StringIO.new
  $stderr = io || StringIO.new
  yield
ensure
  $stdout = old_stdout
  $stderr = old_stderr
end

def capture(&block)
  require 'stringio'
  io = StringIO.new
  silence(io, &block)
  io.string
end

Spec::Runner.configure do |config|
  config.after(:each) do
    class << Object
      public :remove_const
    end
    Object.remove_const("Rails") rescue nil
    rm_rf "vendor"
  end
end

Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
aslakhellesoy-warbler-0.9.12 spec/spec_helper.rb
aslakhellesoy-warbler-0.9.13.4 spec/spec_helper.rb
aslakhellesoy-warbler-0.9.13 spec/spec_helper.rb
bekkopen-warbler-0.9.13.1 spec/spec_helper.rb
finnlabs-warbler-0.9.14 spec/spec_helper.rb
fjc-warbler-0.9.12 spec/spec_helper.rb
manalang-warbler-0.9.12.1 spec/spec_helper.rb
nicksieger-warbler-0.9.12 spec/spec_helper.rb
nicksieger-warbler-0.9.13 spec/spec_helper.rb
nicksieger-warbler-0.9.14 spec/spec_helper.rb
warbler-0.9.14 spec/spec_helper.rb
warbler-0.9.11 spec/spec_helper.rb
warbler-0.9.12 spec/spec_helper.rb
warbler-0.9.13 spec/spec_helper.rb