Skip to content

Commit

Permalink
inject env from the request
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrayford committed Feb 17, 2012
1 parent 50807fa commit a6eabe0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/raptor/injector.rb
Expand Up @@ -104,7 +104,8 @@ def sources(injector)
{:request => lambda { @request },
:http_method => lambda { @request.request_method },
:path => lambda { @request.path_info },
:params => lambda { @request.params }
:params => lambda { @request.params },
:env => lambda { @request.env }
}
end
end
Expand Down
4 changes: 4 additions & 0 deletions spec/injectables_spec.rb
Expand Up @@ -24,6 +24,10 @@
it "injects request params" do
subject.sources(injector).fetch(:params).call.should == {"param" => "value"}
end

it "injects env" do
subject.sources(injector).fetch(:env).call.should == req.env
end
end

describe Raptor::Injectables::RouteVariable do
Expand Down

0 comments on commit a6eabe0

Please sign in to comment.