dcrec1-rspec-vraptor 0.2.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.textile CHANGED
@@ -1,3 +1,7 @@
1
+ Before runnint specs:
2
+
3
+ [code]export CLASSPATH=inc/servlet-api-2.5.jar:inc/vraptor-2.6.3.jar:inc/log4j-1.2.12.jar[/code]
4
+
1
5
  h2. LICENSE:
2
6
 
3
7
  (The MIT License)
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "rspec-vraptor"
8
- GEM_VERSION = "0.2.2"
8
+ GEM_VERSION = "0.3.5"
9
9
  SUMMARY = "RSpec for VRaptor Sexy URLs"
10
10
  AUTHOR = "Diego Carrion"
11
11
  EMAIL = "dc.rec1@gmail.com"
data/lib/environment.rb CHANGED
@@ -20,6 +20,6 @@ end
20
20
  req 'config'
21
21
  req 'http_session'
22
22
  req 'http_request'
23
+ req 'http_response'
23
24
  req 'request_dispatcher'
24
- req 'response'
25
25
  req 'servlet_context'
@@ -0,0 +1,17 @@
1
+ class MockedHttpResponse
2
+ include HttpServletResponse
3
+ attr_accessor :status, :error
4
+
5
+ def initialize
6
+ @status = 200
7
+ end
8
+
9
+ def set_status(x)
10
+ @status = x
11
+ end
12
+
13
+ def send_error(code, msg = '')
14
+ @error = {:code => code, :msg => msg}
15
+ end
16
+
17
+ end
@@ -27,4 +27,5 @@ class MockedHttpSession
27
27
  def remove_attribute(key)
28
28
  @attributes.delete(key)
29
29
  end
30
+
30
31
  end
data/lib/spec/vraptor.rb CHANGED
@@ -1,11 +1,12 @@
1
1
  require File.dirname(__FILE__) + '/../environment'
2
2
 
3
- def get(x, params_request = {}, params_session = {}, injection = {}, headers = {})
3
+ def get(x, map = {}) #params_request = {}, params_session = {}, injection = {}, headers = {})
4
4
  init
5
- @response = MockedResponse.new
5
+ params = {:request => {}, :session => {}, :inject => {}, :headers => {}}.merge map
6
+ @response = MockedHttpResponse.new
6
7
  dispatcher = MockedRequestDispatcher.new
7
- @session = MockedHttpSession.new($context, params_session, @session_id)
8
- @request = MockedHttpRequest.new(dispatcher, @session, x, Rhyme.translate(params_request), injection, headers, Locale.new('en', 'US'))
8
+ @session = MockedHttpSession.new($context, params[:session], @session_id)
9
+ @request = MockedHttpRequest.new(dispatcher, @session, x, Rhyme.translate(params[:request]), params[:inject], params[:headers], Locale.new('en', 'US'))
9
10
 
10
11
  $filter.do_filter(@request, @response, $chain)
11
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcrec1-rspec-vraptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Carrion
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-20 00:00:00 -08:00
12
+ date: 2009-01-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,7 +23,7 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - lib/spec/vraptor.rb
26
- - lib/spec/vraptor/mocked_response.rb
26
+ - lib/spec/vraptor/mocked_http_response.rb
27
27
  - lib/spec/vraptor/mocked_config.rb
28
28
  - lib/spec/vraptor/mocked_http_session.rb
29
29
  - lib/spec/vraptor/mocked_request_dispatcher.rb
@@ -1,13 +0,0 @@
1
- class MockedResponse
2
- include HttpServletResponse
3
- attr_accessor :status
4
-
5
- def initialize
6
- @status = 200
7
- end
8
-
9
- def set_status(x)
10
- @status = x
11
- end
12
-
13
- end