From cc8c4d7cd9b8bac8c8c023ce832711d1c9b418df Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Wed, 23 Aug 2017 23:51:08 +0900 Subject: [PATCH 1/4] Update rspec --- sinatra-jsonp.gemspec | 2 +- spec/spec_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sinatra-jsonp.gemspec b/sinatra-jsonp.gemspec index 63a9834..5fbf940 100644 --- a/sinatra-jsonp.gemspec +++ b/sinatra-jsonp.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |s| s.add_dependency "sinatra", "~> 1.0" s.add_dependency "multi_json", "~> 1.8" - s.add_development_dependency 'rspec', '~> 2.3' + s.add_development_dependency 'rspec', '~> 3.0' s.add_development_dependency 'rake', '>= 0' s.add_development_dependency 'sinatra-contrib', '~> 1.0' s.add_development_dependency 'test-unit', '~> 3.0.9' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 697f3d5..0017346 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ require 'sinatra/jsonp' RSpec.configure do |config| - config.expect_with :rspec, :stdlib + config.expect_with :rspec config.include Sinatra::TestHelpers end From 46af8358055232bbf2a9a194ba9bb4cba27e5aa4 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Thu, 24 Aug 2017 00:04:00 +0900 Subject: [PATCH 2/4] Update sinatra --- sinatra-jsonp.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sinatra-jsonp.gemspec b/sinatra-jsonp.gemspec index 5fbf940..513161a 100644 --- a/sinatra-jsonp.gemspec +++ b/sinatra-jsonp.gemspec @@ -4,13 +4,14 @@ Gem::Specification.new do |s| s.version = "0.4.4" s.description = "JSONP output helper for Sinatra" - s.add_dependency "sinatra", "~> 1.0" + s.add_dependency "sinatra", ">= 1.0" s.add_dependency "multi_json", "~> 1.8" s.add_development_dependency 'rspec', '~> 3.0' s.add_development_dependency 'rake', '>= 0' - s.add_development_dependency 'sinatra-contrib', '~> 1.0' + s.add_development_dependency 'sinatra-contrib', '>= 1.0' s.add_development_dependency 'test-unit', '~> 3.0.9' + s.add_development_dependency 'rack-test', '~> 0.7.0' s.authors = ["Serg Podtynnyi"] s.email = "serg.podtynnyi@gmail.com" From 23f483f2078a80ff17fc3dc3ec562cbda7d51def Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Thu, 24 Aug 2017 00:11:56 +0900 Subject: [PATCH 3/4] Change to `expect` syntax `should` is deprecated. --- spec/jsonp_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/jsonp_spec.rb b/spec/jsonp_spec.rb index 774126f..62cd81b 100644 --- a/spec/jsonp_spec.rb +++ b/spec/jsonp_spec.rb @@ -19,25 +19,25 @@ it "returns JSON if no callback passed" do get '/method' - body.should == '["hello","hi","hallo"]' + expect(body).to eq '["hello","hi","hallo"]' end it "returns JSONP if callback passed via request params" do get '/method?callback=functionA' - body.should == 'functionA(["hello","hi","hallo"])' + expect(body).to eq 'functionA(["hello","hi","hallo"])' end it "returns JSONP with sanitized callback" do get '/method', { :callback=>'foo' } - body.should == 'fooscriptalert1script(["hello","hi","hallo"])' + expect(body).to eq 'fooscriptalert1script(["hello","hi","hallo"])' end it "returns JSONP if callback passed via method param" do get '/method_with_params' - body.should == 'functionA(["hello","hi","hallo"])' + expect(body).to eq 'functionA(["hello","hi","hallo"])' end it "returns JSONP with callback passed via method params even if it passed via request param" do get '/method_with_params?callback=functionB' - body.should == 'functionA(["hello","hi","hallo"])' + expect(body).to eq 'functionA(["hello","hi","hallo"])' end it "return pretty JSON if :json_pretty enabled" do @@ -50,6 +50,6 @@ end end get '/method' - body.should == "[\n \"hello\",\n \"hi\",\n \"hallo\"\n]" + expect(body).to eq "[\n \"hello\",\n \"hi\",\n \"hallo\"\n]" end end From 2205152de46bf8e889c43087f171945904ef9780 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Thu, 24 Aug 2017 00:15:16 +0900 Subject: [PATCH 4/4] Update .travis.yml --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c7f5ec..3645475 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: ruby rvm: - - 1.9.3 + - 2.4 + - 2.3 + - 2.2 - jruby - ruby-head before_install: