Sha256: b975e80ac954cd72ed0eb876a6528eb8ab0380774c8fc513d9d1f837f7ff4424

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

SPEC_DIR = File.dirname(__FILE__)
lib_path = File.expand_path("#{SPEC_DIR}/../lib")
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)

require 'rubygems'
require 'rack/test'

require 'happy'

module SpecHelpers
  def app
    subject
  end

  def response_for
    yield if block_given?
    last_response
  end

  def build_controller(&blk)
    Happy::Controller.build do
      route do
        instance_exec(&blk)
      end
    end
  end
end

RSpec.configure do |conf|
  conf.include Rack::Test::Methods
  conf.include SpecHelpers
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
happy-0.1.0.pre13 spec/spec_helper.rb
happy-0.1.0.pre12 spec/spec_helper.rb