chicago 0.3.12 → 0.3.13

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/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ *.tmproj
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.12
1
+ 0.3.13
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chicago}
8
- s.version = "0.3.12"
8
+ s.version = "0.3.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin 'Gus' Knowlden"]
12
- s.date = %q{2010-05-12}
12
+ s.date = %q{2010-05-17}
13
13
  s.description = %q{Sinatra runtime and testing extensions used commonly by Thumblemonks. For example, :json_response, which turns an object into JSON and sets the content-type appropriately.}
14
14
  s.email = %q{gus@gusg.us}
15
15
  s.extra_rdoc_files = [
@@ -3,6 +3,14 @@ require 'json'
3
3
  module Chicago
4
4
  module Riot
5
5
  module Macros
6
+ def asserts_response(method=nil)
7
+ if method
8
+ asserts("response #{method}") { last_response.send(method) }
9
+ else
10
+ asserts("response") { last_response }
11
+ end
12
+ end
13
+
6
14
  def asserts_response_status(expected)
7
15
  asserts("response status is #{expected}") { last_response.status }.equals(expected)
8
16
  end
@@ -40,4 +40,13 @@ context "Riot Macros Test:" do
40
40
  asserts_json_response("text/javascript;charset=utf-8") { {:foo => bar_value}.to_json }
41
41
  end # with content expectation provided as block
42
42
  end # json response
43
+
44
+ context "response body" do
45
+ context "with a block for the expected value" do
46
+ setup { get('/basic-json') }
47
+ asserts_response(:body).equals do
48
+ {:foo => "bar"}.to_json
49
+ end
50
+ end # with a block for the expected value
51
+ end # response body
43
52
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 12
9
- version: 0.3.12
8
+ - 13
9
+ version: 0.3.13
10
10
  platform: ruby
11
11
  authors:
12
12
  - Justin 'Gus' Knowlden
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-12 00:00:00 -05:00
17
+ date: 2010-05-17 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency