remi-rackbox 1.1.1 → 1.1.2

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.markdown CHANGED
@@ -92,6 +92,7 @@ TODO
92
92
 
93
93
  - request('/', :format => :json) # simple helpers for content type request accepts
94
94
  - get usage documentation working for `./script/generate blackbox_spec`
95
+ - refactor all specs ... an app should implement a simple API that we can spec against ... some URIs should return session vars, some request vars, etc
95
96
 
96
97
 
97
98
 
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 1
4
- :patch: 1
4
+ :patch: 2
@@ -35,9 +35,16 @@ class RackBox
35
35
  # TODO take any additional options and pass them along to the environment, so we can say
36
36
  # req '/', :user_agent => 'some custom user agent'
37
37
  #
38
- def req app_or_request, url, options = {}
38
+ def req app_or_request, url = nil, options = {}
39
39
  puts "RackBox#request url:#{ url.inspect }, options:#{ options.inspect }" if RackBox.verbose
40
40
 
41
+ # handle RackBox.request '/foo'
42
+ if app_or_request.is_a?(String) && ( url.nil? || url.is_a?(Hash) )
43
+ options = url || {}
44
+ url = app_or_request
45
+ app_or_request = RackBox.app
46
+ end
47
+
41
48
  # need to find the request or app
42
49
  mock_request = nil
43
50
  if app_or_request.is_a? Rack::MockRequest
@@ -14,4 +14,10 @@ describe RackBox, '#request' do
14
14
  RackBox.request(@rack_app, '/hello').body.should include('you requested path /hello')
15
15
  end
16
16
 
17
+ it "should default to using RackBox.app if an app isn't passed" do
18
+ lambda { RackBox.request('/hello') }.should raise_error
19
+ RackBox.app = @rack_app
20
+ RackBox.request('/hello').body.should include('you requested path /hello')
21
+ end
22
+
17
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remi-rackbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - remi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-09 00:00:00 -08:00
12
+ date: 2009-03-05 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15