Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
specs for #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Scott authored and Zachary Scott committed Jun 10, 2014
1 parent e1d920f commit 1dbcec9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spec/namespace_spec.rb
Expand Up @@ -672,4 +672,37 @@ class BError < AError; end
end
end
end

describe 'settings' do
it 'provides access to top-level settings' do
mock_app do
set :foo, 'ok'

namespace '/foo' do
get '/bar' do
settings.foo
end
end
end

get('/foo/bar').status.should == 200
last_response.body.should == 'ok'
end

it 'uses some repro' do
mock_app do
set :foo, 42

namespace '/foo' do
get '/bar' do
#settings.respond_to?(:foo).to_s
settings.foo.to_s
end
end
end

get('/foo/bar').status.should == 200
last_response.body.should == '42'
end
end
end

0 comments on commit 1dbcec9

Please sign in to comment.