Module: BigBand::Integration::Test
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/big_band/integration/test.rb
Overview
This encapsulates general test helpers. See Bacon, RSpec, Test::Spec and Test::Unit for examples.
Constant Summary collapse
- Spec =
BigBand::Integration::TestSpec
- Unit =
BigBand::Integration::TestUnit
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#app(*options, &block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/big_band/integration/test.rb', line 19 def app(*, &block) unless block.nil? and .empty? superclass = .first if .size == 1 and .first.is_a? Class superclass ||= BigBand(*) @app = Class.new(superclass, &block) inspection = "app" inspection << "(" << .map { |o| o.inspect }.join(", ") << ")" unless .empty? inspection << " { ... }" if block @app.class_eval "def self.inspect; #{inspection.inspect}; end" end @app || BigBand.applications.last || Sinatra::Application end |
Instance Method Details
#browse_route(verb, *args, &block) ⇒ Object
36 37 38 39 |
# File 'lib/big_band/integration/test.rb', line 36 def browse_route(verb, *args, &block) send(verb, *args, &block) last_response end |
#define_route(verb, *args, &block) ⇒ Object
32 33 34 |
# File 'lib/big_band/integration/test.rb', line 32 def define_route(verb, *args, &block) app.send(verb, *args, &block) end |