Fix for RSpec 3 compatibility.

f38
Jun Aruga 8 years ago
parent b9004780b8
commit d916622b07

@ -0,0 +1,51 @@
From df93a5a78dd555e933396a5fc7f74e81e97d7cb5 Mon Sep 17 00:00:00 2001
From: Jun Aruga <jaruga@redhat.com>
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

@ -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 <jaruga@redhat.com> - 1.5.3-4
- Fix for RSpec 3 compatibility.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

@ -1 +1 @@
e09611d89bb40fb901c80b43c2a8c446 rack-protection-1.5.3.gem
SHA512 (rack-protection-1.5.3.gem) = 9f94f9f25197c3f8227f5c9c9fd2e896e35bfc08d4a20f4dded9c42772f348d16dceda6916429833b498b29c4dbba4dbb31b1a3cf90de597fb6df2de145d655a

Loading…
Cancel
Save