Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix equalization of Request::Rack

  • Loading branch information...
commit 95cd14c5271a492d5debf1716ca879fc3072a213 1 parent 39db490
@mbj authored
View
4 Changelog.md
@@ -1,3 +1,7 @@
+# v0.0.4 2013-05-21
+
+- Fix equalizing of Request::Rack
+
# v0.0.3 2013-05-21
- Regression in Request::Rack#rack_env
View
22 lib/request/rack.rb
@@ -1,14 +1,32 @@
class Request
# Rack request
class Rack < self
- include Concord::Public.new(:rack_env)
-
SERVER_PORT = Key.new('SERVER_PORT')
REQUEST_METHOD = Key.new('REQUEST_METHOD')
RACK_URL_SCHEME = Key.new('rack.url_scheme')
IF_MODIFIED_SINCE = Key.new('HTTP_IF_MODIFIED_SINCE')
CONTENT_LENGTH = Key.new('CONTENT_LENGTH')
+ # Initialize object
+ #
+ # @param [Hash] rack_env
+ #
+ # @return [undefined]
+ #
+ # @api private
+ #
+ def initialize(rack_env)
+ @rack_env = rack_env
+ end
+
+ # Return rack env
+ #
+ # @return [Hash]
+ #
+ # @api private
+ #
+ attr_reader :rack_env
+
# Declare accessor
#
# @param [Symbol] name
View
6 spec/unit/request/rack/rack_env_spec.rb
@@ -1,13 +1,13 @@
require 'spec_helper'
describe Request::Rack, '#rack_env' do
- let(:object) { described_class.new(rack_env) }
-
subject { object.rack_env }
+ let(:object) { described_class.new(rack_env) }
+
let(:rack_env) { mock('Rack Env') }
it { should be(rack_env) }
- it_should_behave_like 'a command method'
+ it_should_behave_like 'an idempotent method'
end
Please sign in to comment.
Something went wrong with that request. Please try again.