rest-assured 1.1.9 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +66 -0
- data/Gemfile +11 -12
- data/Gemfile.lock +113 -104
- data/README.markdown +27 -83
- data/Rakefile +0 -2
- data/features/step_definitions/doubles_steps.rb +4 -3
- data/features/support/env.rb +3 -7
- data/lib/rest-assured/config.rb +4 -3
- data/lib/rest-assured/version.rb +1 -1
- data/rest-assured.gemspec +1 -1
- metadata +56 -19
data/CHANGELOG
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
1.1.10 (09 Jan 2013)
|
2
|
+
|
3
|
+
- support jruby versions of sqlite and myslq gems
|
4
|
+
|
5
|
+
1.1.9 (17 May 2012)
|
6
|
+
|
7
|
+
- minor UI tweaks
|
8
|
+
|
9
|
+
1.1.8 (11 May 2012)
|
10
|
+
|
11
|
+
- add status to UI
|
12
|
+
- support PATCH
|
13
|
+
- minor UI tweeks
|
14
|
+
|
15
|
+
1.1.5 (19 Apr 2012)
|
16
|
+
|
17
|
+
- add Double.all and Double#destroy
|
18
|
+
|
19
|
+
1.1.3 (21 Mar 2012)
|
20
|
+
|
21
|
+
- support long (>256 chars) fullpath
|
22
|
+
|
23
|
+
1.1.2 (04 Mar 2012)
|
24
|
+
|
25
|
+
- support postgres
|
26
|
+
- heroku deployable
|
27
|
+
|
28
|
+
1.1.1 (01 Mar 2012)
|
29
|
+
|
30
|
+
- Add 'verb' to UI
|
31
|
+
- No more forked version of Server
|
32
|
+
|
33
|
+
1.1.0 (17 Feb 2012)
|
34
|
+
|
35
|
+
- Redirects support 'real' (without http redirect) rewrite to local double
|
36
|
+
|
37
|
+
1.0.0 (14 Feb 2012)
|
38
|
+
|
39
|
+
- start/stop rest-assured via api
|
40
|
+
- redirects support pattern/replacement
|
41
|
+
|
42
|
+
0.3.2 (23 Jan 2012)
|
43
|
+
|
44
|
+
- double 'activeness' does not take verb into account (bugfix)
|
45
|
+
|
46
|
+
0.3.1 (09 Jan 2012)
|
47
|
+
|
48
|
+
- lock rack version to <= 1.3.6 until they release fix for https://github.com/rack/rack/issues/299
|
49
|
+
|
50
|
+
0.3 (12 Dec 2011)
|
51
|
+
|
52
|
+
- you can now specify response headers for double to respond with
|
53
|
+
|
54
|
+
0.2
|
55
|
+
|
56
|
+
- adds verifications
|
57
|
+
- adds ruby client
|
58
|
+
- adds custom return statuses
|
59
|
+
- adds ssl
|
60
|
+
- adds mysql support
|
61
|
+
|
62
|
+
0.1
|
63
|
+
|
64
|
+
- initial public release
|
65
|
+
|
66
|
+
|
data/Gemfile
CHANGED
@@ -8,32 +8,31 @@ gem 'thin'
|
|
8
8
|
|
9
9
|
# skipped for heroku
|
10
10
|
group :test do
|
11
|
-
gem 'awesome_print'
|
12
11
|
gem 'cucumber'
|
13
12
|
gem 'database_cleaner'
|
14
13
|
gem 'rspec'
|
15
14
|
gem 'shoulda-matchers'
|
15
|
+
gem 'anticipate'
|
16
16
|
gem 'rack-test'
|
17
|
-
gem 'capybara'
|
18
|
-
gem 'capybara-firebug'
|
17
|
+
gem 'capybara', '~> 1.1'
|
19
18
|
gem 'rake'
|
20
19
|
gem 'mysql2'
|
21
20
|
gem 'sqlite3'
|
22
|
-
gem '
|
23
|
-
|
24
|
-
gem "spork", "> 0.9.0.rc"
|
21
|
+
gem 'chromedriver-helper'
|
22
|
+
|
25
23
|
gem 'simplecov', :platforms => :ruby_19
|
24
|
+
gem 'awesome_print'
|
25
|
+
gem "spork", "> 0.9.0.rc"
|
26
26
|
end
|
27
27
|
|
28
28
|
# skipped for heroku and travis
|
29
29
|
group :development do
|
30
|
-
gem '
|
31
|
-
gem '
|
32
|
-
gem '
|
30
|
+
gem 'relish'
|
31
|
+
gem 'pry'
|
32
|
+
gem 'pry-doc'
|
33
|
+
gem 'pry-stack_explorer', :platforms => :ruby_19
|
34
|
+
gem 'pry-debugger', :platforms => :ruby_19
|
33
35
|
gem 'launchy'
|
34
36
|
gem "guard-spork"
|
35
|
-
gem 'growl'
|
36
|
-
gem 'rb-fsevent'
|
37
|
-
gem 'rb-readline'
|
38
37
|
end
|
39
38
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rest-assured (1.1.
|
4
|
+
rest-assured (1.1.10)
|
5
5
|
activerecord (~> 3.2.0)
|
6
6
|
activeresource (~> 3.2.0)
|
7
7
|
childprocess (~> 0.3.0)
|
@@ -13,25 +13,29 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: http://rubygems.org/
|
15
15
|
specs:
|
16
|
-
activemodel (3.2.
|
17
|
-
activesupport (= 3.2.
|
16
|
+
activemodel (3.2.11)
|
17
|
+
activesupport (= 3.2.11)
|
18
18
|
builder (~> 3.0.0)
|
19
|
-
activerecord (3.2.
|
20
|
-
activemodel (= 3.2.
|
21
|
-
activesupport (= 3.2.
|
19
|
+
activerecord (3.2.11)
|
20
|
+
activemodel (= 3.2.11)
|
21
|
+
activesupport (= 3.2.11)
|
22
22
|
arel (~> 3.0.2)
|
23
23
|
tzinfo (~> 0.3.29)
|
24
|
-
activeresource (3.2.
|
25
|
-
activemodel (= 3.2.
|
26
|
-
activesupport (= 3.2.
|
27
|
-
activesupport (3.2.
|
24
|
+
activeresource (3.2.11)
|
25
|
+
activemodel (= 3.2.11)
|
26
|
+
activesupport (= 3.2.11)
|
27
|
+
activesupport (3.2.11)
|
28
28
|
i18n (~> 0.6)
|
29
29
|
multi_json (~> 1.0)
|
30
|
-
addressable (2.2
|
30
|
+
addressable (2.3.2)
|
31
|
+
anticipate (0.0.2)
|
31
32
|
archive-tar-minitar (0.5.2)
|
32
33
|
arel (3.0.2)
|
33
|
-
awesome_print (1.0
|
34
|
-
|
34
|
+
awesome_print (1.1.0)
|
35
|
+
binding_of_caller (0.6.8)
|
36
|
+
bourne (1.1.2)
|
37
|
+
mocha (= 0.10.5)
|
38
|
+
builder (3.0.4)
|
35
39
|
capybara (1.1.2)
|
36
40
|
mime-types (>= 1.16)
|
37
41
|
nokogiri (>= 1.3.3)
|
@@ -39,145 +43,150 @@ GEM
|
|
39
43
|
rack-test (>= 0.5.4)
|
40
44
|
selenium-webdriver (~> 2.0)
|
41
45
|
xpath (~> 0.1.4)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
childprocess (0.3.6)
|
47
|
+
ffi (~> 1.0, >= 1.0.6)
|
48
|
+
chromedriver-helper (0.0.5)
|
49
|
+
nokogiri
|
50
|
+
coderay (1.0.8)
|
46
51
|
columnize (0.3.6)
|
47
|
-
cucumber (1.1
|
52
|
+
cucumber (1.2.1)
|
48
53
|
builder (>= 2.1.2)
|
49
|
-
diff-lcs (>= 1.1.
|
50
|
-
gherkin (~> 2.
|
54
|
+
diff-lcs (>= 1.1.3)
|
55
|
+
gherkin (~> 2.11.0)
|
51
56
|
json (>= 1.4.6)
|
52
|
-
|
53
|
-
|
54
|
-
|
57
|
+
daemons (1.1.9)
|
58
|
+
database_cleaner (0.9.1)
|
59
|
+
debugger (1.2.3)
|
60
|
+
columnize (>= 0.3.1)
|
61
|
+
debugger-linecache (~> 1.1.1)
|
62
|
+
debugger-ruby_core_source (~> 1.1.5)
|
63
|
+
debugger-linecache (1.1.2)
|
64
|
+
debugger-ruby_core_source (>= 1.1.1)
|
65
|
+
debugger-ruby_core_source (1.1.6)
|
55
66
|
diff-lcs (1.1.3)
|
56
|
-
eventmachine (0.
|
57
|
-
ffi (1.0
|
58
|
-
gherkin (2.
|
67
|
+
eventmachine (1.0.0)
|
68
|
+
ffi (1.3.0)
|
69
|
+
gherkin (2.11.5)
|
59
70
|
json (>= 1.4.6)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
71
|
+
guard (1.6.1)
|
72
|
+
listen (>= 0.6.0)
|
73
|
+
lumberjack (>= 1.0.2)
|
74
|
+
pry (>= 0.9.10)
|
75
|
+
thor (>= 0.14.6)
|
76
|
+
guard-spork (1.4.1)
|
77
|
+
childprocess (>= 0.2.3)
|
78
|
+
guard (>= 1.1)
|
66
79
|
spork (>= 0.8.4)
|
67
|
-
haml (3.1.
|
68
|
-
i18n (0.6.
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
addressable
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
+
haml (3.1.7)
|
81
|
+
i18n (0.6.1)
|
82
|
+
json (1.7.6)
|
83
|
+
launchy (2.1.2)
|
84
|
+
addressable (~> 2.3)
|
85
|
+
libwebsocket (0.1.7.1)
|
86
|
+
addressable
|
87
|
+
websocket
|
88
|
+
listen (0.7.1)
|
89
|
+
lumberjack (1.0.2)
|
90
|
+
metaclass (0.0.1)
|
91
|
+
method_source (0.8.1)
|
92
|
+
mime-types (1.19)
|
93
|
+
mocha (0.10.5)
|
94
|
+
metaclass (~> 0.0.1)
|
95
|
+
multi_json (1.5.0)
|
80
96
|
mysql2 (0.3.11)
|
81
|
-
nokogiri (1.5.
|
82
|
-
pg (0.
|
83
|
-
|
84
|
-
|
97
|
+
nokogiri (1.5.6)
|
98
|
+
pg (0.14.1)
|
99
|
+
pry (0.9.10)
|
100
|
+
coderay (~> 1.0.5)
|
101
|
+
method_source (~> 0.8)
|
102
|
+
slop (~> 3.3.1)
|
103
|
+
pry-debugger (0.2.1)
|
104
|
+
debugger (~> 1.2.0)
|
105
|
+
pry (~> 0.9.10)
|
106
|
+
pry-doc (0.4.4)
|
107
|
+
pry (>= 0.9.9.6)
|
108
|
+
yard (~> 0.8.1)
|
109
|
+
pry-stack_explorer (0.4.7)
|
110
|
+
binding_of_caller (~> 0.6.8)
|
111
|
+
rack (1.4.3)
|
112
|
+
rack-protection (1.3.2)
|
85
113
|
rack
|
86
|
-
rack-test (0.6.
|
114
|
+
rack-test (0.6.2)
|
87
115
|
rack (>= 1.0)
|
88
|
-
rake (0.
|
89
|
-
|
90
|
-
rb-readline (0.4.2)
|
91
|
-
rbx-require-relative (0.0.9)
|
92
|
-
relish (0.5.3)
|
116
|
+
rake (10.0.3)
|
117
|
+
relish (0.6)
|
93
118
|
archive-tar-minitar (>= 0.5.2)
|
94
119
|
json (>= 1.4.6)
|
95
120
|
rest-client (>= 1.6.1)
|
96
121
|
rest-client (1.6.7)
|
97
122
|
mime-types (>= 1.16)
|
98
|
-
rspec (2.
|
99
|
-
rspec-core (~> 2.
|
100
|
-
rspec-expectations (~> 2.
|
101
|
-
rspec-mocks (~> 2.
|
102
|
-
rspec-core (2.
|
103
|
-
rspec-expectations (2.
|
104
|
-
diff-lcs (~> 1.1.
|
105
|
-
rspec-mocks (2.
|
106
|
-
|
107
|
-
|
108
|
-
ruby-debug-base (~> 0.10.4.0)
|
109
|
-
ruby-debug-base (0.10.4)
|
110
|
-
linecache (>= 0.3)
|
111
|
-
ruby-debug-base19 (0.11.25)
|
112
|
-
columnize (>= 0.3.1)
|
113
|
-
linecache19 (>= 0.5.11)
|
114
|
-
ruby_core_source (>= 0.1.4)
|
115
|
-
ruby-debug19 (0.11.6)
|
116
|
-
columnize (>= 0.3.1)
|
117
|
-
linecache19 (>= 0.5.11)
|
118
|
-
ruby-debug-base19 (>= 0.11.19)
|
119
|
-
ruby_core_source (0.1.5)
|
120
|
-
archive-tar-minitar (>= 0.5.2)
|
121
|
-
rubyzip (0.9.6.1)
|
122
|
-
selenium-webdriver (2.20.0)
|
123
|
+
rspec (2.12.0)
|
124
|
+
rspec-core (~> 2.12.0)
|
125
|
+
rspec-expectations (~> 2.12.0)
|
126
|
+
rspec-mocks (~> 2.12.0)
|
127
|
+
rspec-core (2.12.2)
|
128
|
+
rspec-expectations (2.12.1)
|
129
|
+
diff-lcs (~> 1.1.3)
|
130
|
+
rspec-mocks (2.12.1)
|
131
|
+
rubyzip (0.9.9)
|
132
|
+
selenium-webdriver (2.27.2)
|
123
133
|
childprocess (>= 0.2.5)
|
124
|
-
|
134
|
+
libwebsocket (~> 0.1.3)
|
125
135
|
multi_json (~> 1.0)
|
126
136
|
rubyzip
|
127
|
-
shoulda-matchers (1.
|
128
|
-
|
137
|
+
shoulda-matchers (1.4.2)
|
138
|
+
activesupport (>= 3.0.0)
|
139
|
+
bourne (~> 1.1.2)
|
140
|
+
simplecov (0.7.1)
|
129
141
|
multi_json (~> 1.0)
|
130
|
-
simplecov-html (~> 0.
|
131
|
-
simplecov-html (0.
|
132
|
-
sinatra (1.3.
|
142
|
+
simplecov-html (~> 0.7.1)
|
143
|
+
simplecov-html (0.7.1)
|
144
|
+
sinatra (1.3.3)
|
133
145
|
rack (~> 1.3, >= 1.3.6)
|
134
146
|
rack-protection (~> 1.2)
|
135
147
|
tilt (~> 1.3, >= 1.3.3)
|
136
|
-
sinatra-activerecord (0.1.3)
|
137
|
-
sinatra (>= 0.9.4)
|
138
148
|
sinatra-flash (0.3.0)
|
139
149
|
sinatra (>= 1.0.0)
|
140
|
-
|
141
|
-
spork (1.0.
|
142
|
-
sqlite3 (1.3.
|
143
|
-
|
144
|
-
thin (1.3.1)
|
150
|
+
slop (3.3.3)
|
151
|
+
spork (1.0.0rc3)
|
152
|
+
sqlite3 (1.3.6)
|
153
|
+
thin (1.5.0)
|
145
154
|
daemons (>= 1.0.9)
|
146
155
|
eventmachine (>= 0.12.6)
|
147
156
|
rack (>= 1.0.0)
|
148
|
-
thor (0.
|
157
|
+
thor (0.16.0)
|
149
158
|
tilt (1.3.3)
|
150
|
-
tzinfo (0.3.
|
159
|
+
tzinfo (0.3.35)
|
160
|
+
websocket (1.0.6)
|
151
161
|
xpath (0.1.4)
|
152
162
|
nokogiri (~> 1.3)
|
163
|
+
yard (0.8.3)
|
153
164
|
|
154
165
|
PLATFORMS
|
155
166
|
ruby
|
156
167
|
|
157
168
|
DEPENDENCIES
|
169
|
+
anticipate
|
158
170
|
awesome_print
|
159
|
-
capybara
|
160
|
-
|
171
|
+
capybara (~> 1.1)
|
172
|
+
chromedriver-helper
|
161
173
|
cucumber
|
162
174
|
database_cleaner
|
163
|
-
growl
|
164
175
|
guard-spork
|
165
|
-
interactive_editor
|
166
176
|
launchy
|
167
177
|
mysql2
|
168
178
|
pg
|
179
|
+
pry
|
180
|
+
pry-debugger
|
181
|
+
pry-doc
|
182
|
+
pry-stack_explorer
|
169
183
|
rack-test
|
170
184
|
rake
|
171
|
-
rb-fsevent
|
172
|
-
rb-readline
|
173
185
|
relish
|
174
186
|
rest-assured!
|
175
187
|
rspec
|
176
|
-
ruby-debug
|
177
|
-
ruby-debug19
|
178
188
|
shoulda-matchers
|
179
189
|
simplecov
|
180
|
-
sinatra-activerecord
|
181
190
|
spork (> 0.9.0.rc)
|
182
191
|
sqlite3
|
183
192
|
thin
|
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# REST assured
|
2
2
|
|
3
|
-
[![Build status](https://secure.travis-ci.org/
|
3
|
+
[![Build status](https://secure.travis-ci.org/artemave/REST-assured.png)](https://secure.travis-ci.org/artemave/REST-assured)
|
4
4
|
|
5
5
|
## Overview
|
6
6
|
|
@@ -26,6 +26,8 @@ You are going to need ruby >= 1.8.7 on Linux/MacOS. Also, one of sqlite3, postgr
|
|
26
26
|
```ruby
|
27
27
|
# Gemfile
|
28
28
|
gem 'sqlite3' # or mysql2 or pg
|
29
|
+
# for jruby, use 'jdbcsqlite3' and 'jdbcmysql'
|
30
|
+
|
29
31
|
gem 'thin' # to make it faster; optional
|
30
32
|
gem 'rest-assured'
|
31
33
|
|
@@ -41,24 +43,24 @@ RestAssured::Server.address = 'http://localhost:4578' # or wherever it is
|
|
41
43
|
|
42
44
|
Install db client gem:
|
43
45
|
|
44
|
-
|
46
|
+
$ gem install sqlite3 # or mysql2 or pg
|
45
47
|
|
46
48
|
If using mysql/postgres, rest-assured expects database `rest_assured` to be accessible by user `root` with no password. Those are defaults and can be changed with cli options.
|
47
49
|
|
48
50
|
It is also recommended to have thin installed. This improves startup time (over default webrick) and also it works with in-memory sqlite (which webrick does not):
|
49
51
|
|
50
|
-
|
52
|
+
$ gem install thin
|
51
53
|
|
52
54
|
Then install gem and run:
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
+
$ gem install rest-assured
|
57
|
+
$ rest-assured &
|
56
58
|
|
57
59
|
Or clone and run:
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
|
61
|
+
$ git clone git://github.com/artemave/REST-assured.git
|
62
|
+
$ cd REST-assured && bundle install
|
63
|
+
$ ./bin/rest-assured -d :memory: & # in-memory sqlite db
|
62
64
|
|
63
65
|
This starts up an instance of rest-assured on port 4578. It is accessible via REST or web interfaces on `http://localhost:4578`
|
64
66
|
|
@@ -66,14 +68,14 @@ Various options (such as ssl, port, db credentials, etc.) are available through
|
|
66
68
|
|
67
69
|
You can also deploy it to heroku:
|
68
70
|
|
69
|
-
|
70
|
-
|
71
|
+
$ git clone git://github.com/artemave/REST-assured.git
|
72
|
+
$ cd REST-assured
|
71
73
|
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
$ gem install heroku
|
75
|
+
$ heroku login # assuming you already have an account
|
76
|
+
$ heroku create --stack cedar
|
75
77
|
|
76
|
-
|
78
|
+
$ git push heroku master
|
77
79
|
|
78
80
|
## Usage
|
79
81
|
|
@@ -136,10 +138,10 @@ For those using REST-assured from non-ruby environments.
|
|
136
138
|
Example:
|
137
139
|
|
138
140
|
```
|
139
|
-
|
141
|
+
$ curl -d 'fullpath=/api/something&content=awesome&response_headers%5BContent-Type%5D=text%2Fhtml' http://localhost:4578/doubles
|
140
142
|
{"double":{"active":true,"content":"awesome","description":null,"fullpath":"/api/something","id":1,"response_headers":{"Content-Type":"text/html"},"status":200,"verb":"GET"}}
|
141
143
|
|
142
|
-
|
144
|
+
$ curl http://localhost:4578/api/something
|
143
145
|
awesome
|
144
146
|
```
|
145
147
|
|
@@ -151,7 +153,7 @@ For those using REST-assured from non-ruby environments.
|
|
151
153
|
|
152
154
|
Example:
|
153
155
|
|
154
|
-
|
156
|
+
$ curl http://localhost:4578/doubles/1.json | prettify_json.rb
|
155
157
|
{
|
156
158
|
"double": {
|
157
159
|
"verb": "GET",
|
@@ -205,8 +207,10 @@ Here is the rest API for managing redirects:
|
|
205
207
|
- __to__ - url base e.g, `http://example.com/api/\1?p=1` where `\1` is a reference to captured group from the pattern. Mandatory
|
206
208
|
|
207
209
|
Example:
|
208
|
-
|
209
|
-
|
210
|
+
|
211
|
+
```
|
212
|
+
$ curl -d 'pattern=^/auth&to=https://myserver.com/api' http://localhost:4578/redirects
|
213
|
+
```
|
210
214
|
|
211
215
|
Now request (any verb) to `http://localhost:4578/auth/services/1` will get redirected to `https://myserver.com/api/`. Provided of course there is no double matched for that fullpath and verb. Captured group in pattern can be referenced from replacement e.g. `\1`, `\2`, etc.
|
212
216
|
Much like rewrite rules, redirects are evaluated in order (of creation). In UI you can manually rearrange the order.
|
@@ -219,71 +223,11 @@ Here is the rest API for managing redirects:
|
|
219
223
|
|
220
224
|
Tests require there to be mysql database `rest_assured_test` accessible by `root` with no password. Cucumber tests also need firefox.
|
221
225
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
+
$ git clone git://github.com/artemave/REST-assured.git
|
227
|
+
$ cd rest-assured && bundle install
|
228
|
+
$ bundle exec rspec spec
|
229
|
+
$ bundle exec cucumber
|
226
230
|
|
227
231
|
## Author
|
228
232
|
|
229
233
|
[Artem Avetisyan](https://github.com/artemave)
|
230
|
-
|
231
|
-
## Changelog
|
232
|
-
|
233
|
-
#### 1.1.8 (11 May 2012)
|
234
|
-
|
235
|
-
* add status to UI
|
236
|
-
* support PATCH
|
237
|
-
* minor UI tweeks
|
238
|
-
|
239
|
-
#### 1.1.5 (19 Apr 2012)
|
240
|
-
|
241
|
-
* add Double.all and Double#destroy
|
242
|
-
|
243
|
-
#### 1.1.3 (21 Mar 2012)
|
244
|
-
|
245
|
-
* support long (>256 chars) fullpath
|
246
|
-
|
247
|
-
#### 1.1.2 (04 Mar 2012)
|
248
|
-
|
249
|
-
* support postgres
|
250
|
-
* heroku deployable
|
251
|
-
|
252
|
-
#### 1.1.1 (01 Mar 2012)
|
253
|
-
|
254
|
-
* Add 'verb' to UI
|
255
|
-
* No more forked version of Server
|
256
|
-
|
257
|
-
#### 1.1.0 (17 Feb 2012)
|
258
|
-
|
259
|
-
* Redirects support 'real' (without http redirect) rewrite to local double
|
260
|
-
|
261
|
-
#### 1.0.0 (14 Feb 2012)
|
262
|
-
|
263
|
-
* start/stop rest-assured via api
|
264
|
-
* redirects support pattern/replacement
|
265
|
-
|
266
|
-
#### 0.3.2 (23 Jan 2012)
|
267
|
-
|
268
|
-
* double 'activeness' does not take verb into account (bugfix)
|
269
|
-
|
270
|
-
#### 0.3.1 (09 Jan 2012)
|
271
|
-
|
272
|
-
* lock rack version to <= 1.3.6 until they release fix for https://github.com/rack/rack/issues/299
|
273
|
-
|
274
|
-
#### 0.3 (12 Dec 2011)
|
275
|
-
|
276
|
-
* you can now specify response headers for double to respond with
|
277
|
-
|
278
|
-
#### 0.2
|
279
|
-
|
280
|
-
* adds verifications
|
281
|
-
* adds ruby client
|
282
|
-
* adds custom return statuses
|
283
|
-
* adds ssl
|
284
|
-
* adds mysql support
|
285
|
-
|
286
|
-
#### 0.1
|
287
|
-
|
288
|
-
* initial public release
|
289
|
-
|
data/Rakefile
CHANGED
@@ -136,10 +136,11 @@ When /^I make (first|second) double active$/ do |ord|
|
|
136
136
|
end
|
137
137
|
|
138
138
|
Then /^(first|second) double should be served$/ do |ord|
|
139
|
-
sleep 0.1 # allow time for change to end up in the db
|
140
139
|
f = instance_variable_get('@' + ord)
|
141
|
-
|
142
|
-
|
140
|
+
sleeping(0.1).seconds.between_tries.failing_after(20).tries do
|
141
|
+
get f.fullpath
|
142
|
+
last_response.body.should == f.content
|
143
|
+
end
|
143
144
|
end
|
144
145
|
|
145
146
|
Given /^I choose to edit (?:double|redirect)$/ do
|
data/features/support/env.rb
CHANGED
@@ -7,14 +7,13 @@ Spork.prefork do
|
|
7
7
|
require 'rspec'
|
8
8
|
require 'rack/test'
|
9
9
|
require 'capybara'
|
10
|
-
require 'capybara/firebug'
|
11
10
|
require 'capybara/cucumber'
|
12
11
|
require 'database_cleaner'
|
12
|
+
require 'anticipate'
|
13
13
|
require 'awesome_print'
|
14
14
|
require 'rest-assured/utils/port_explorer'
|
15
15
|
require File.dirname(__FILE__) + '/world_helpers'
|
16
16
|
|
17
|
-
|
18
17
|
ENV['RACK_ENV'] = 'test'
|
19
18
|
|
20
19
|
module RackHeaderHack
|
@@ -31,13 +30,10 @@ Spork.prefork do
|
|
31
30
|
end
|
32
31
|
|
33
32
|
Capybara.register_driver :selenium do |app|
|
34
|
-
|
35
|
-
profile.enable_firebug
|
36
|
-
|
37
|
-
Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile)
|
33
|
+
Capybara::Selenium::Driver.new(app, :browser => :chrome)
|
38
34
|
end
|
39
35
|
|
40
|
-
World(Capybara, Rack::Test::Methods, RackHeaderHack, WorldHelpers)
|
36
|
+
World(Capybara, Rack::Test::Methods, RackHeaderHack, WorldHelpers, Anticipate)
|
41
37
|
|
42
38
|
require 'rest-assured/config'
|
43
39
|
db_opts = { :adapter => 'mysql' }
|
data/lib/rest-assured/config.rb
CHANGED
@@ -134,8 +134,9 @@ module RestAssured
|
|
134
134
|
else
|
135
135
|
File.expand_path("../../../db/#{AppConfig.environment}.db", __FILE__)
|
136
136
|
end
|
137
|
+
adapter = RUBY_PLATFORM == "java" ? 'jdbcsqlite3' : 'sqlite3'
|
137
138
|
{
|
138
|
-
:adapter =>
|
139
|
+
:adapter => adapter,
|
139
140
|
:database => AppConfig.database || default_database
|
140
141
|
}
|
141
142
|
elsif AppConfig.adapter =~ /postgres|mysql/i
|
@@ -152,10 +153,10 @@ module RestAssured
|
|
152
153
|
:username => AppConfig.user || 'root',
|
153
154
|
:database => AppConfig.database || default_database
|
154
155
|
}
|
155
|
-
|
156
156
|
if adapter =~ /mysql/
|
157
|
+
adapter = RUBY_PLATFORM == "java" ? 'jdbcmysql' : 'mysql2'
|
157
158
|
opts.merge!(
|
158
|
-
:adapter =>
|
159
|
+
:adapter => adapter,
|
159
160
|
:reconnect => true,
|
160
161
|
:pool => 20
|
161
162
|
)
|
data/lib/rest-assured/version.rb
CHANGED
data/rest-assured.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ['Artem Avetisyan']
|
10
10
|
s.email = ['artem.avetisyan@bbc.co.uk']
|
11
|
-
s.homepage = "https://github.com/
|
11
|
+
s.homepage = "https://github.com/artemave/rest-assured"
|
12
12
|
s.summary = %q{Real stubs and spies for HTTP(S) services}
|
13
13
|
#s.description = %q{TODO: Write a gem description}
|
14
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-assured
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 1.3.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.3.2
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: childprocess
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 0.3.0
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.3.0
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: sinatra-flash
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: haml
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: 3.1.3
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 3.1.3
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: activerecord
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ~>
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: 3.2.0
|
66
86
|
type: :runtime
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 3.2.0
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: activeresource
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ~>
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: 3.2.0
|
77
102
|
type: :runtime
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 3.2.0
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: json
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,7 +117,12 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :runtime
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
description:
|
92
127
|
email:
|
93
128
|
- artem.avetisyan@bbc.co.uk
|
@@ -99,6 +134,7 @@ files:
|
|
99
134
|
- .gitignore
|
100
135
|
- .rspec
|
101
136
|
- .travis.yml
|
137
|
+
- CHANGELOG
|
102
138
|
- Gemfile
|
103
139
|
- Gemfile.lock
|
104
140
|
- Guardfile
|
@@ -203,7 +239,7 @@ files:
|
|
203
239
|
- views/redirects/edit.haml
|
204
240
|
- views/redirects/index.haml
|
205
241
|
- views/redirects/new.haml
|
206
|
-
homepage: https://github.com/
|
242
|
+
homepage: https://github.com/artemave/rest-assured
|
207
243
|
licenses: []
|
208
244
|
post_install_message:
|
209
245
|
rdoc_options: []
|
@@ -223,10 +259,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
259
|
version: '0'
|
224
260
|
segments:
|
225
261
|
- 0
|
226
|
-
hash:
|
262
|
+
hash: 2865940547805814270
|
227
263
|
requirements: []
|
228
264
|
rubyforge_project: rest-assured
|
229
|
-
rubygems_version: 1.8.
|
265
|
+
rubygems_version: 1.8.23
|
230
266
|
signing_key:
|
231
267
|
specification_version: 3
|
232
268
|
summary: Real stubs and spies for HTTP(S) services
|
@@ -265,3 +301,4 @@ test_files:
|
|
265
301
|
- spec/spec_helper.rb
|
266
302
|
- spec/support/custom_matchers.rb
|
267
303
|
- spec/support/reset-singleton.rb
|
304
|
+
has_rdoc:
|