Sha256: c5a29c2bdcb48628c377ff1af892c06e052e965455075c4abf797fe7ef746a63

Contents?: true

Size: 953 Bytes

Versions: 8

Compression:

Stored size: 953 Bytes

Contents

#--
# Copyright (c) 2010 Engine Yard, Inc.
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
# This source code is available under the MIT license.
# See the file LICENSE.txt for 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

8 entries across 8 versions & 2 rubygems

Version Path
warbler-1.2.1 spec/spec_helper.rb
warbler-1.2.0 spec/spec_helper.rb
rdmopensource-warbler-1.1.0 spec/spec_helper.rb
warbler-1.1.0 spec/spec_helper.rb
warbler-1.0.3 spec/spec_helper.rb
warbler-1.0.2 spec/spec_helper.rb
warbler-1.0.1 spec/spec_helper.rb
warbler-1.0 spec/spec_helper.rb