Skip to content
Newer
Older
100644 34 lines (25 sloc) 681 Bytes
9a27404 @rkh add reimplementation of sinatra-extension
rkh authored
1 require 'backports'
2 require_relative 'spec_helper'
3
4 describe Sinatra::Extension do
5 module ExampleExtension
6 extend Sinatra::Extension
7
8 set :foo, :bar
9 settings.set :bar, :blah
10
11 configure :test, :production do
12 set :reload_stuff, false
13 end
14
15 configure :development do
16 set :reload_stuff, true
17 end
18
19 get '/' do
20 "from extension, yay"
21 end
22 end
23
24 before { mock_app { register ExampleExtension }}
25
26 it('allows using set') { settings.foo.should == :bar }
27 it('implements configure') { settings.reload_stuff.should be_false }
28
29 it 'allows defing routes' do
30 get('/').should be_ok
31 body.should == "from extension, yay"
32 end
33 end
Something went wrong with that request. Please try again.