rest-assured 2.0.0 → 2.0.1

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/README.markdown +12 -19
  4. data/db/development.db +0 -0
  5. data/db/test.db +0 -0
  6. data/features/ruby_api/test_server.feature +4 -4
  7. data/features/step_definitions/command_line_options_steps.rb +1 -1
  8. data/features/step_definitions/doubles_steps.rb +1 -1
  9. data/features/support/env.rb +3 -3
  10. data/features/support/world_helpers.rb +2 -8
  11. data/lib/rest-assured/api/app_session.rb +6 -1
  12. data/lib/rest-assured/api/server.rb +2 -14
  13. data/lib/rest-assured/config.rb +10 -3
  14. data/lib/rest-assured/models/double.rb +0 -2
  15. data/lib/rest-assured/models/redirect.rb +1 -3
  16. data/lib/rest-assured/routes/double.rb +2 -2
  17. data/lib/rest-assured/version.rb +1 -1
  18. data/spec/api/app_session_spec.rb +11 -5
  19. data/spec/api/resource_double_spec.rb +14 -13
  20. data/spec/api/server_spec.rb +38 -43
  21. data/spec/config_spec.rb +3 -3
  22. data/spec/functional/double_routes_spec.rb +53 -53
  23. data/spec/functional/redirect_routes_spec.rb +27 -27
  24. data/spec/functional/response_spec.rb +18 -18
  25. data/spec/models/double_spec.rb +22 -27
  26. data/spec/models/redirect_spec.rb +12 -15
  27. data/spec/models/request_spec.rb +4 -4
  28. data/spec/port_explorer_spec.rb +3 -3
  29. data/spec/spec_helper.rb +30 -22
  30. metadata +24 -37
  31. data/.gitignore +0 -9
  32. data/.rspec +0 -1
  33. data/.travis.yml +0 -15
  34. data/Gemfile +0 -36
  35. data/Gemfile.lock +0 -176
  36. data/Guardfile +0 -10
  37. data/Procfile +0 -1
  38. data/Rakefile +0 -2
  39. data/bin/console +0 -11
  40. data/bin/heroku_runner +0 -27
  41. data/cucumber.yml +0 -3
  42. data/features/support/test-server.rb +0 -35
  43. data/rest-assured.gemspec +0 -31
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- *.gem
2
- .bundle
3
- pkg/*
4
- bundle_bin
5
- *.db
6
- .sass-cache
7
- test.log
8
- coverage
9
- .rvmrc
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,15 +0,0 @@
1
- bundler_args: --without development
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0
6
- env: DISPLAY=:99.0
7
- before_script:
8
- - "mysql -e 'create database rest_assured_test;'"
9
- - "sh -e /etc/init.d/xvfb start"
10
- script: "bundle exec rspec spec && bundle exec cucumber --format progress"
11
- branches:
12
- only:
13
- - master
14
- notifications:
15
- email: false
data/Gemfile DELETED
@@ -1,36 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- ruby '2.1.0'
4
-
5
- gemspec
6
-
7
- gem 'pg'
8
-
9
- # skipped for heroku
10
- group :test do
11
- gem 'cucumber'
12
- gem 'selenium-webdriver'
13
- gem 'database_cleaner'
14
- gem 'rspec'
15
- gem 'shoulda-matchers'
16
- gem 'anticipate'
17
- gem 'rack-test'
18
- gem 'capybara'
19
- gem 'rake'
20
- gem 'mysql2'
21
- gem 'sqlite3'
22
- gem 'chromedriver-helper'
23
- gem 'simplecov'
24
- gem 'awesome_print'
25
- end
26
-
27
- # skipped for heroku and travis
28
- group :development do
29
- gem 'relish'
30
- gem 'pry'
31
- gem 'pry-doc'
32
- gem 'pry-stack_explorer'
33
- gem 'pry-debugger'
34
- gem 'launchy'
35
- end
36
-
@@ -1,176 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- rest-assured (1.2.2)
5
- activerecord (~> 3.0)
6
- activeresource (~> 3.0)
7
- childprocess (~> 0.3)
8
- haml (~> 4.0)
9
- sinatra (~> 1.4.0)
10
- sinatra-flash
11
- thin (~> 1.6)
12
-
13
- GEM
14
- remote: https://rubygems.org/
15
- specs:
16
- activemodel (3.2.16)
17
- activesupport (= 3.2.16)
18
- builder (~> 3.0.0)
19
- activerecord (3.2.16)
20
- activemodel (= 3.2.16)
21
- activesupport (= 3.2.16)
22
- arel (~> 3.0.2)
23
- tzinfo (~> 0.3.29)
24
- activeresource (3.2.16)
25
- activemodel (= 3.2.16)
26
- activesupport (= 3.2.16)
27
- activesupport (3.2.16)
28
- i18n (~> 0.6, >= 0.6.4)
29
- multi_json (~> 1.0)
30
- addressable (2.3.5)
31
- anticipate (0.1.1)
32
- archive-tar-minitar (0.5.2)
33
- arel (3.0.3)
34
- awesome_print (1.2.0)
35
- binding_of_caller (0.7.2)
36
- debug_inspector (>= 0.0.1)
37
- builder (3.0.4)
38
- capybara (2.2.1)
39
- mime-types (>= 1.16)
40
- nokogiri (>= 1.3.3)
41
- rack (>= 1.0.0)
42
- rack-test (>= 0.5.4)
43
- xpath (~> 2.0)
44
- childprocess (0.4.0)
45
- ffi (~> 1.0, >= 1.0.11)
46
- chromedriver-helper (0.0.5)
47
- nokogiri
48
- coderay (1.1.0)
49
- columnize (0.3.6)
50
- cucumber (1.3.10)
51
- builder (>= 2.1.2)
52
- diff-lcs (>= 1.1.3)
53
- gherkin (~> 2.12)
54
- multi_json (>= 1.7.5, < 2.0)
55
- multi_test (>= 0.0.2)
56
- daemons (1.1.9)
57
- database_cleaner (1.2.0)
58
- debug_inspector (0.0.2)
59
- debugger (1.6.5)
60
- columnize (>= 0.3.1)
61
- debugger-linecache (~> 1.2.0)
62
- debugger-ruby_core_source (~> 1.3.1)
63
- debugger-linecache (1.2.0)
64
- debugger-ruby_core_source (1.3.1)
65
- diff-lcs (1.2.5)
66
- docile (1.1.2)
67
- eventmachine (1.0.3)
68
- ffi (1.9.3)
69
- gherkin (2.12.2)
70
- multi_json (~> 1.3)
71
- haml (4.0.5)
72
- tilt
73
- i18n (0.6.9)
74
- json (1.8.1)
75
- launchy (2.4.2)
76
- addressable (~> 2.3)
77
- method_source (0.8.2)
78
- mime-types (2.1)
79
- mini_portile (0.5.2)
80
- multi_json (1.8.4)
81
- multi_test (0.0.3)
82
- mysql2 (0.3.15)
83
- nokogiri (1.6.1)
84
- mini_portile (~> 0.5.0)
85
- pg (0.17.1)
86
- pry (0.9.12.6)
87
- coderay (~> 1.0)
88
- method_source (~> 0.8)
89
- slop (~> 3.4)
90
- pry-debugger (0.2.2)
91
- debugger (~> 1.3)
92
- pry (~> 0.9.10)
93
- pry-doc (0.5.1)
94
- pry (>= 0.9)
95
- yard (>= 0.8)
96
- pry-stack_explorer (0.4.9.1)
97
- binding_of_caller (>= 0.7)
98
- pry (>= 0.9.11)
99
- rack (1.5.2)
100
- rack-protection (1.5.2)
101
- rack
102
- rack-test (0.6.2)
103
- rack (>= 1.0)
104
- rake (10.1.1)
105
- relish (0.7)
106
- archive-tar-minitar (>= 0.5.2)
107
- json (>= 1.4.6)
108
- rest-client (>= 1.6.1)
109
- rest-client (1.6.7)
110
- mime-types (>= 1.16)
111
- rspec (2.14.1)
112
- rspec-core (~> 2.14.0)
113
- rspec-expectations (~> 2.14.0)
114
- rspec-mocks (~> 2.14.0)
115
- rspec-core (2.14.7)
116
- rspec-expectations (2.14.4)
117
- diff-lcs (>= 1.1.3, < 2.0)
118
- rspec-mocks (2.14.4)
119
- rubyzip (1.1.0)
120
- selenium-webdriver (2.39.0)
121
- childprocess (>= 0.2.5)
122
- multi_json (~> 1.0)
123
- rubyzip (~> 1.0)
124
- websocket (~> 1.0.4)
125
- shoulda-matchers (2.5.0)
126
- activesupport (>= 3.0.0)
127
- simplecov (0.8.2)
128
- docile (~> 1.1.0)
129
- multi_json
130
- simplecov-html (~> 0.8.0)
131
- simplecov-html (0.8.0)
132
- sinatra (1.4.4)
133
- rack (~> 1.4)
134
- rack-protection (~> 1.4)
135
- tilt (~> 1.3, >= 1.3.4)
136
- sinatra-flash (0.3.0)
137
- sinatra (>= 1.0.0)
138
- slop (3.4.7)
139
- sqlite3 (1.3.8)
140
- thin (1.6.1)
141
- daemons (>= 1.0.9)
142
- eventmachine (>= 1.0.0)
143
- rack (>= 1.0.0)
144
- tilt (1.4.1)
145
- tzinfo (0.3.38)
146
- websocket (1.0.7)
147
- xpath (2.0.0)
148
- nokogiri (~> 1.3)
149
- yard (0.8.7.3)
150
-
151
- PLATFORMS
152
- ruby
153
-
154
- DEPENDENCIES
155
- anticipate
156
- awesome_print
157
- capybara
158
- chromedriver-helper
159
- cucumber
160
- database_cleaner
161
- launchy
162
- mysql2
163
- pg
164
- pry
165
- pry-debugger
166
- pry-doc
167
- pry-stack_explorer
168
- rack-test
169
- rake
170
- relish
171
- rest-assured!
172
- rspec
173
- selenium-webdriver
174
- shoulda-matchers
175
- simplecov
176
- sqlite3
data/Guardfile DELETED
@@ -1,10 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'spork', :cucumber_env => { 'RACK_ENV' => 'test' }, :rspec_env => { 'RACK_ENV' => 'test' } do
5
- watch('Gemfile')
6
- watch('Gemfile.lock')
7
- watch(%r{spec/.+\.rb})
8
- watch(%r{features/support/.+\.rb$})
9
- watch(%r{^lib/.+\.rb$})
10
- end
data/Procfile DELETED
@@ -1 +0,0 @@
1
- web: bundle exec ./bin/heroku_runner
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require "irb"
3
-
4
- $:.push File.expand_path('../../lib', __FILE__)
5
-
6
- require 'rest-assured/config'
7
- RestAssured::Config.build :database => ( ENV['FRS_DB'] || File.expand_path('../../db/development.db', __FILE__) )
8
-
9
- require 'rest-assured/application'
10
-
11
- IRB.start(__FILE__)
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $:.push File.expand_path('../../lib', __FILE__)
4
-
5
- require 'rest-assured/config'
6
- require 'uri'
7
-
8
- # disable buffering to have log messages sent straight to Heroku’s logging infrastructure
9
- $stdout.sync = true
10
-
11
- db = URI.parse(ENV['DATABASE_URL'])
12
-
13
- opts = {
14
- port: ENV['PORT'],
15
- adapter: 'postgresql',
16
- dbhost: db.host,
17
- user: db.user,
18
- dbpass: db.password,
19
- dbport: db.port,
20
- database: db.path[1..-1],
21
- encoding: 'utf8'
22
- }
23
-
24
- RestAssured::Config.build(opts)
25
-
26
- require 'rest-assured/application'
27
- RestAssured::Application.run!(:threaded => false)
@@ -1,3 +0,0 @@
1
- default: --tags ~@long
2
- long: --tags @long
3
- wip: --tags @wip
@@ -1,35 +0,0 @@
1
- require 'net/http'
2
- require 'childprocess'
3
-
4
- # This is only needed till someone gets ActiveResource going through rack-test
5
- class TestServer
6
- def self.start(opts = {})
7
- @server_port = opts[:port] || 9876
8
- db_user = opts[:db_user] || 'root'
9
-
10
- print "Starting TestServer server... "
11
-
12
- @child = ChildProcess.build("bundle exec rest-assured -p #@server_port -a mysql -u #{db_user}")
13
- @child.io.inherit!
14
- @child.start
15
-
16
- puts 'Done.'
17
- end
18
-
19
- def self.stop
20
- print 'Shutting down TestServer server... '
21
- @child.stop
22
- puts 'Done.'
23
- end
24
-
25
- def self.server_address
26
- "http://localhost:#{@server_port}"
27
- end
28
-
29
- def self.up?
30
- Net::HTTP.new('localhost', @server_port).head('/')
31
- true
32
- rescue Errno::ECONNREFUSED
33
- false
34
- end
35
- end
@@ -1,31 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require 'rest-assured/version'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "rest-assured"
7
- s.version = RestAssured::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ['Artem Avetisyan']
10
- s.email = ['artemave@gmail.com']
11
- s.homepage = "https://github.com/artemave/rest-assured"
12
- s.summary = %q{Real stubs and spies for HTTP(S) services}
13
- #s.description = %q{TODO: Write a gem description}
14
-
15
- s.rubyforge_project = "rest-assured"
16
- s.required_ruby_version = '>= 1.8.7'
17
-
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = ['rest-assured']
21
- s.require_paths = ['lib']
22
-
23
- s.add_dependency 'sinatra', '~> 1.4.0'
24
- s.add_dependency 'childprocess', '~> 0.3'
25
- s.add_dependency 'sinatra-flash'
26
- s.add_dependency 'haml', '~> 4.0'
27
- s.add_dependency 'activerecord', '~> 3.0'
28
- s.add_dependency 'activeresource', '~> 3.0'
29
- s.add_dependency 'thin', '~> 1.6'
30
- end
31
-