Module: BigBand::Integration

Defined in:
lib/big_band/integration/test.rb,
lib/big_band/integration.rb,
lib/big_band/integration/monk.rb,
lib/big_band/integration/rake.rb,
lib/big_band/integration/yard.rb,
lib/big_band/integration/bacon.rb,
lib/big_band/integration/rspec.rb,
lib/big_band/integration/test_spec.rb,
lib/big_band/integration/test_unit.rb

Overview

Webrat.configure { |config| config.mode = :sinatra }

Defined Under Namespace

Modules: Bacon, Monk, RSpec, Rake, Test, TestSpec, TestUnit, YARD

Constant Summary collapse

GLOBBER =
"{lib/**,app/**,routes/**,models/**,views/**,controllers/**,.}/*.rb"
Yard =
YARD
Rspec =
RSpec

Class Method Summary collapse

Class Method Details

.each_route(source) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/big_band/integration.rb', line 29

def self.each_route(source)
  routes_for(source).each do |verb, routes|
    routes.each do |route|
      #route.path ||= route.pattern
      yield(verb, route)
    end
  end
end

.routes_for(source) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/big_band/integration.rb', line 12

def self.routes_for(source)
  case source
  when Class
    source.routes
  when String
    require "big_band/advanced_routes"
    require "big_band/integration/yard"
    ::YARD::Registry.load(Dir[source], true)
    YARD::Handlers::Sinatra::AbstractRouteHandler.routes.inject({}) do |routes, r|
      (routes[r.http_verb] ||= []) << AdvancedRoutes::Route.new(r.http_verb, :path => r.http_path, :docstring => r.docstring, :file => r.file)
      routes
    end
  else
    raise ArgumentError, "cannot retrieve routes for #{source.inspect}"
  end
end