File tree Expand file tree Collapse file tree 5 files changed +11
-15
lines changed Expand file tree Collapse file tree 5 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ group :test do
26
26
gem 'rack-test'
27
27
gem 'rspec', '~> 3.0'
28
28
gem 'cookiejar'
29
- gem 'rack-contrib '
29
+ gem 'rack-jsonp', require: 'rack/jsonp '
30
30
gem 'mime-types', '< 3.0'
31
31
gem 'danger', '~> 2.0'
32
32
end
Original file line number Diff line number Diff line change @@ -374,12 +374,17 @@ def subject.enable_root_route!
374
374
end
375
375
376
376
context 'format' do
377
+ module ApiSpec
378
+ class DummyFormatClass
379
+ end
380
+ end
381
+
377
382
before ( :each ) do
378
- allow_any_instance_of ( Object ) . to receive ( :to_json ) . and_return ( 'abc' )
379
- allow_any_instance_of ( Object ) . to receive ( :to_txt ) . and_return ( 'def' )
383
+ allow_any_instance_of ( ApiSpec :: DummyFormatClass ) . to receive ( :to_json ) . and_return ( 'abc' )
384
+ allow_any_instance_of ( ApiSpec :: DummyFormatClass ) . to receive ( :to_txt ) . and_return ( 'def' )
380
385
381
386
subject . get ( '/abc' ) do
382
- Object . new
387
+ ApiSpec :: DummyFormatClass . new
383
388
end
384
389
end
385
390
Original file line number Diff line number Diff line change @@ -266,8 +266,6 @@ def initialize(args)
266
266
end
267
267
268
268
it 'presents with jsonp utilising Rack::JSONP' do
269
- require 'rack/contrib'
270
-
271
269
# Include JSONP middleware
272
270
subject . use Rack ::JSONP
273
271
Original file line number Diff line number Diff line change 22
22
unless RUBY_PLATFORM == 'java'
23
23
major , minor , patch = Rack . release . split ( '.' ) . map ( &:to_i )
24
24
patch ||= 0 # rack <= 1.5.2 does not specify patch version
25
- pending 'Rack 1.5.3 or 1.6.1 required' unless major >= 1 && ( ( minor == 5 && patch >= 3 ) || ( minor >= 6 ) )
25
+ pending 'Rack 1.5.3 or 1.6.1 required' unless major >= 2 || ( major >= 1 && ( ( minor == 5 && patch >= 3 ) || ( minor >= 6 ) ) )
26
26
end
27
27
28
28
expect ( JSON . parse ( app . call ( env ) [ 2 ] . body . first ) [ 'params_keys' ] ) . to match_array ( 'test' )
Original file line number Diff line number Diff line change 6
6
7
7
require 'rubygems'
8
8
require 'bundler'
9
- Bundler . setup :default , :test
10
-
11
- require 'json'
12
- require 'rack/test'
13
- require 'base64'
14
- require 'cookiejar'
15
- require 'mime/types'
16
- require 'cgi'
9
+ Bundler . require :default , :test
17
10
18
11
Dir [ "#{ File . dirname ( __FILE__ ) } /support/*.rb" ] . each do |file |
19
12
require file
You can’t perform that action at this time.
0 commit comments