Sha256: f252293e19694d639338dae99b29c80bdfb23baa7054419e939bb264767c4600
Contents?: true
Size: 1009 Bytes
Versions: 1
Compression:
Stored size: 1009 Bytes
Contents
require 'securerandom' ENV['RACK_ENV'] = 'test' if ENV['TRAVIS'] require 'coveralls' Coveralls.wear! else require 'simplecov' SimpleCov.start do add_filter "spec" end end require 'nyny' include NYNY class Rack::MockRequest def trace(uri, opts={}) request("TRACE", uri, opts) end def options(uri, opts={}) request("OPTIONS", uri, opts) end end def template name File.join(File.dirname(__FILE__), 'views', name) end def extended_modules_for kls (class << kls; self end).included_modules end def mock_app parent=App, &blk Rack::MockRequest.new mock_app_class(parent, &blk).new end def mock_app_class parent=App, &blk Class.new(parent, &blk) end def random_url levels=1 parts = levels.times.map do SecureRandom.urlsafe_base64 end "/#{parts.join('/')}" end class NullMiddleware def initialize app @app = app end def call env @app.call env end end module NullHelper end RSpec.configure do |c| c.filter_run_excluding :broken => true end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nyny-3.0.1 | spec/spec_helper.rb |