rack-test-rest 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -14,13 +14,13 @@ module Rack
14
14
  post "#{resource_uri}.json", params
15
15
 
16
16
  if expected_code
17
- assert last_response.status == expected_code
17
+ assert_equal(expected_code, last_response.status)
18
18
  else
19
19
  if @rack_test_rest[:debug]
20
20
  puts "#{last_response.status}: #{last_response.body}"
21
21
  puts last_response.original_headers["Location"]
22
22
  end
23
- assert last_response.status == 201
23
+ assert_equal(201, last_response.status)
24
24
  if @rack_test_rest[:location]
25
25
  assert last_response.original_headers["Location"] =~ @rack_test_rest[:location]
26
26
  end
@@ -50,10 +50,10 @@ module Rack
50
50
  end
51
51
 
52
52
  if expected_code
53
- assert last_response.status == expected_code
53
+ assert_equal(expected_code, last_response.status)
54
54
  return nil
55
55
  else
56
- assert last_response.status == 200
56
+ assert_equal(200, last_response.status)
57
57
  return JSON.parse(last_response.body)
58
58
  end
59
59
  end
@@ -72,9 +72,9 @@ module Rack
72
72
  puts "#{last_response.status}: #{last_response.body}" if @rack_test_rest[:debug]
73
73
 
74
74
  if expected_code
75
- assert last_response.status == expected_code
75
+ assert_equal(expected_code, last_response.status)
76
76
  else
77
- assert last_response.status == 204
77
+ assert_equal(204, last_response.status)
78
78
  end
79
79
  end
80
80
 
@@ -82,9 +82,9 @@ module Rack
82
82
  delete "#{resource_uri}/#{params[:id]}.json"
83
83
 
84
84
  if params[:code]
85
- assert last_response.status == params[:code]
85
+ assert_equal(params[:code], last_response.status)
86
86
  else
87
- assert last_response.status == 204
87
+ assert_equal(204, last_response.status)
88
88
  end
89
89
  end
90
90
 
@@ -115,14 +115,14 @@ module Rack
115
115
  pg_resp = read_resource(:offset => offset, :length => length)
116
116
 
117
117
  puts "Received #{pg_resp[@rack_test_rest[:resource]].count} records" if @rack_test_rest[:debug]
118
- assert pg_resp[@rack_test_rest[:resource]].count == expected_length
118
+ assert_equal(expected_length, pg_resp[@rack_test_rest[:resource]].count)
119
119
 
120
120
  puts "Found #{pg_resp["query"]["found"]} records" if @rack_test_rest[:debug]
121
- assert pg_resp["query"]["found"] == count
121
+ assert_equal(count, pg_resp["query"]["found"])
122
122
 
123
- assert pg_resp["query"]["total"] == count
124
- assert pg_resp["query"]["length"] == expected_length
125
- assert pg_resp["query"]["offset"] == offset
123
+ assert_equal(count, pg_resp["query"]["total"])
124
+ assert_equal(expected_length, pg_resp["query"]["length"])
125
+ assert_equal(offset, pg_resp["query"]["offset"])
126
126
 
127
127
  retrieved += expected_length
128
128
  offset = retrieved
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-test-rest}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Joseph Ruscio"]
12
- s.date = %q{2011-04-10}
12
+ s.date = %q{2011-09-02}
13
13
  s.description = %q{rack-test-rest is an extension to rack-test that when combined with Test::Unit simplifies the process of unit testing properly designed RESTful API's.}
14
14
  s.email = %q{joe@ruscio.org}
15
15
  s.extra_rdoc_files = [
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.homepage = %q{http://github.com/josephruscio/rack-test-rest}
33
33
  s.licenses = ["MIT"]
34
34
  s.require_paths = ["lib"]
35
- s.rubygems_version = %q{1.4.2}
35
+ s.rubygems_version = %q{1.6.2}
36
36
  s.summary = %q{Abstractions for testing RESTful API's with rack-test and Test::Unit.}
37
37
  s.test_files = [
38
38
  "test/helper.rb",
metadata CHANGED
@@ -1,93 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rack-test-rest
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Joseph Ruscio
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-04-10 00:00:00 -07:00
12
+ date: 2011-09-02 00:00:00.000000000 -07:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :development
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
32
- requirement: *id001
33
- prerelease: false
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
34
16
  name: shoulda
35
- - !ruby/object:Gem::Dependency
17
+ requirement: &2152553380 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
36
23
  type: :development
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ version_requirements: *2152553380
26
+ - !ruby/object:Gem::Dependency
27
+ name: bundler
28
+ requirement: &2152549900 !ruby/object:Gem::Requirement
38
29
  none: false
39
- requirements:
30
+ requirements:
40
31
  - - ~>
41
- - !ruby/object:Gem::Version
42
- hash: 23
43
- segments:
44
- - 1
45
- - 0
46
- - 0
32
+ - !ruby/object:Gem::Version
47
33
  version: 1.0.0
48
- requirement: *id002
49
- prerelease: false
50
- name: bundler
51
- - !ruby/object:Gem::Dependency
52
34
  type: :development
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
35
+ prerelease: false
36
+ version_requirements: *2152549900
37
+ - !ruby/object:Gem::Dependency
38
+ name: jeweler
39
+ requirement: &2152545740 !ruby/object:Gem::Requirement
54
40
  none: false
55
- requirements:
41
+ requirements:
56
42
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 7
59
- segments:
60
- - 1
61
- - 5
62
- - 2
43
+ - !ruby/object:Gem::Version
63
44
  version: 1.5.2
64
- requirement: *id003
65
- prerelease: false
66
- name: jeweler
67
- - !ruby/object:Gem::Dependency
68
45
  type: :development
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
70
- none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
78
- requirement: *id004
79
46
  prerelease: false
47
+ version_requirements: *2152545740
48
+ - !ruby/object:Gem::Dependency
80
49
  name: rcov
81
- description: rack-test-rest is an extension to rack-test that when combined with Test::Unit simplifies the process of unit testing properly designed RESTful API's.
50
+ requirement: &2152543680 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *2152543680
59
+ description: rack-test-rest is an extension to rack-test that when combined with Test::Unit
60
+ simplifies the process of unit testing properly designed RESTful API's.
82
61
  email: joe@ruscio.org
83
62
  executables: []
84
-
85
63
  extensions: []
86
-
87
- extra_rdoc_files:
64
+ extra_rdoc_files:
88
65
  - LICENSE.txt
89
66
  - README.md
90
- files:
67
+ files:
91
68
  - .document
92
69
  - Gemfile
93
70
  - Gemfile.lock
@@ -101,38 +78,33 @@ files:
101
78
  - test/test_rack-test-rest.rb
102
79
  has_rdoc: true
103
80
  homepage: http://github.com/josephruscio/rack-test-rest
104
- licenses:
81
+ licenses:
105
82
  - MIT
106
83
  post_install_message:
107
84
  rdoc_options: []
108
-
109
- require_paths:
85
+ require_paths:
110
86
  - lib
111
- required_ruby_version: !ruby/object:Gem::Requirement
87
+ required_ruby_version: !ruby/object:Gem::Requirement
112
88
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 3
117
- segments:
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ segments:
118
94
  - 0
119
- version: "0"
120
- required_rubygems_version: !ruby/object:Gem::Requirement
95
+ hash: -410277042666572099
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
97
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3
126
- segments:
127
- - 0
128
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
129
102
  requirements: []
130
-
131
103
  rubyforge_project:
132
- rubygems_version: 1.4.2
104
+ rubygems_version: 1.6.2
133
105
  signing_key:
134
106
  specification_version: 3
135
107
  summary: Abstractions for testing RESTful API's with rack-test and Test::Unit.
136
- test_files:
108
+ test_files:
137
109
  - test/helper.rb
138
110
  - test/test_rack-test-rest.rb