From d916622b07be23043a10b661d5e454a21414c975 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 7 Feb 2017 17:18:00 +0100 Subject: [PATCH] Fix for RSpec 3 compatibility. --- ...rotection-1.5.3-rspec3-compatibility.patch | 51 +++++++++++++++++++ rubygem-rack-protection.spec | 12 +++-- sources | 2 +- 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 rubygem-rack-protection-1.5.3-rspec3-compatibility.patch diff --git a/rubygem-rack-protection-1.5.3-rspec3-compatibility.patch b/rubygem-rack-protection-1.5.3-rspec3-compatibility.patch new file mode 100644 index 0000000..79f61e7 --- /dev/null +++ b/rubygem-rack-protection-1.5.3-rspec3-compatibility.patch @@ -0,0 +1,51 @@ +From df93a5a78dd555e933396a5fc7f74e81e97d7cb5 Mon Sep 17 00:00:00 2001 +From: Jun Aruga +Date: Mon, 6 Feb 2017 21:25:10 +0100 +Subject: [PATCH] RSpec 3 compatibility. + +--- + spec/protection_spec.rb | 6 +++--- + spec/spec_helper.rb | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/spec/protection_spec.rb b/spec/protection_spec.rb +index 083670c..c15a544 100755 +--- a/spec/protection_spec.rb ++++ b/spec/protection_spec.rb +@@ -68,17 +68,17 @@ describe Rack::Protection do + describe "#html?" do + context "given an appropriate content-type header" do + subject { Rack::Protection::Base.new(nil).html? 'content-type' => "text/html" } +- it { should be_true } ++ it { should be_truthy } + end + + context "given an inappropriate content-type header" do + subject { Rack::Protection::Base.new(nil).html? 'content-type' => "image/gif" } +- it { should be_false } ++ it { should be_falsey } + end + + context "given no content-type header" do + subject { Rack::Protection::Base.new(nil).html?({}) } +- it { should be_false } ++ it { should be_falsey } + end + end + +diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb +index 6a3a8f8..5caccd8 100644 +--- a/spec/spec_helper.rb ++++ b/spec/spec_helper.rb +@@ -93,7 +93,7 @@ module NotImplementedAsPending + end + + RSpec.configure do |config| +- config.expect_with :rspec, :stdlib ++ config.expect_with :rspec + config.include Rack::Test::Methods + config.include TestHelpers + end +-- +2.7.4 + diff --git a/rubygem-rack-protection.spec b/rubygem-rack-protection.spec index 3c21dbc..9c58d9a 100644 --- a/rubygem-rack-protection.spec +++ b/rubygem-rack-protection.spec @@ -5,16 +5,18 @@ Summary: Ruby gem that protects against typical web attacks Name: rubygem-%{gem_name} Version: 1.5.3 -Release: 3%{?dist} +Release: 4%{?dist} Group: Development/Languages License: MIT URL: http://github.com/rkh/rack-protection Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem +# rack-protection was merged to sinatra 2. It is RSpec3 compatibility. +Patch0: rubygem-rack-protection-1.5.3-rspec3-compatibility.patch BuildRequires: rubygems-devel %if 0%{bootstrap} < 1 BuildRequires: rubygem(test-unit) BuildRequires: rubygem(rack) -BuildRequires: rubygem(rspec) < 3 +BuildRequires: rubygem(rspec) BuildRequires: rubygem(rack-test) %endif BuildArch: noarch @@ -43,7 +45,8 @@ rm .%{gem_cache} %check %if 0%{bootstrap} < 1 pushd .%{gem_instdir} -rspec2 spec +cat %{PATCH0} | patch -p1 +rspec spec popd %endif @@ -69,6 +72,9 @@ chmod a-x %{buildroot}%{gem_instdir}/spec/protection_spec.rb %doc %{gem_docdir} %changelog +* Tue Feb 07 2017 Jun Aruga - 1.5.3-4 +- Fix for RSpec 3 compatibility. + * Thu Feb 04 2016 Fedora Release Engineering - 1.5.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 5e48cc4..7d6d46d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e09611d89bb40fb901c80b43c2a8c446 rack-protection-1.5.3.gem +SHA512 (rack-protection-1.5.3.gem) = 9f94f9f25197c3f8227f5c9c9fd2e896e35bfc08d4a20f4dded9c42772f348d16dceda6916429833b498b29c4dbba4dbb31b1a3cf90de597fb6df2de145d655a