Sha256: f00e69cefce0d4755a7321c9f99a4b00ebb8f01ecaa0b18e6d17249ab2fa49e4

Contents?: true

Size: 1.43 KB

Versions: 7

Compression:

Stored size: 1.43 KB

Contents

ENV["RAILS_ENV"] ||= 'test'

require 'simplecov'
SimpleCov.start if ENV["COVERAGE"]

require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'thin'

$:.push File.expand_path("../../lib", __FILE__)
require 'websocket-rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir["./spec/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  # == Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec
  
  config.include WebsocketRails::HelperMethods

  # If true, the base class of anonymous controllers will be inferred
  # automatically. This will be the default behavior in future versions of
  # rspec-rails.
  config.infer_base_class_for_anonymous_controllers = false
  
  config.before(:all) do
    silence_output
  end
  
  config.after(:all) do
    enable_output
  end
end

def silence_output
  @orig_stderr = $stderr
  @orig_stdout = $stdout

  # redirect stderr and stdout to /dev/null
  $stderr = File.new('/dev/null', 'w')
  $stdout = File.new('/dev/null', 'w')
end

# Replace stdout and stderr so anything else is output correctly.
def enable_output
  $stderr = @orig_stderr
  $stdout = @orig_stdout
  @orig_stderr = nil
  @orig_stdout = nil
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
websocket-rails-0.1.9 spec/spec_helper.rb
websocket-rails-0.1.8 spec/spec_helper.rb
websocket-rails-0.1.7 spec/spec_helper.rb
websocket-rails-0.1.6 spec/spec_helper.rb
websocket-rails-0.1.5 spec/spec_helper.rb
websocket-rails-0.1.4 spec/spec_helper.rb
websocket-rails-0.1.3 spec/spec_helper.rb