[DRE-commits] [ruby-semverse] 04/06: Added patch for RSpec3 (Closes: #795050)

Jonas Genannt genannt at moszumanska.debian.org
Wed Aug 19 12:10:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

genannt pushed a commit to branch master
in repository ruby-semverse.

commit 45497c89f50c75b3ba3172a4808366273d651eac
Author: Jonas Genannt <jonas at brachium-system.net>
Date:   Wed Aug 19 14:03:44 2015 +0200

    Added patch for RSpec3 (Closes: #795050)
---
 debian/patches/rspec3.patch | 258 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series       |   1 +
 2 files changed, 259 insertions(+)

diff --git a/debian/patches/rspec3.patch b/debian/patches/rspec3.patch
new file mode 100644
index 0000000..1ae4630
--- /dev/null
+++ b/debian/patches/rspec3.patch
@@ -0,0 +1,258 @@
+From 40277eb4ede44355fc52dfbd810e613ef25c35ce Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:04:10 -0800
+Subject: [PATCH 1/7] Require rspec ~> 2.99
+Bug: https://patch-diff.githubusercontent.com/raw/berkshelf/semverse/pull/5.patch
+
+Tests break in newer versions of RSpec due to deprecated usage.
+---
+ Gemfile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Gemfile b/Gemfile
+index 205cedc..1ec7d22 100644
+--- a/Gemfile
++++ b/Gemfile
+@@ -25,5 +25,5 @@ end
+ group :test do
+   gem "spork"
+   gem "rake"
+-  gem "rspec"
++  gem "rspec", "~> 2.99"
+ end
+
+From d4437e37be6479f8417a76638a65ff063f09ef50 Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:11:12 -0800
+Subject: [PATCH 2/7] Rewrite defunct 'have' matchers
+
+---
+ spec/unit/semverse/version_spec.rb | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/spec/unit/semverse/version_spec.rb b/spec/unit/semverse/version_spec.rb
+index 11c611d..411d512 100644
+--- a/spec/unit/semverse/version_spec.rb
++++ b/spec/unit/semverse/version_spec.rb
+@@ -224,12 +224,12 @@
+ 
+     describe "::split" do
+       it "returns an array containing 5 elements" do
+-        expect(subject.split("1.2.0-alpha.1")).to have(5).items
++        expect(subject.split("1.2.0-alpha.1").size).to eq(5)
+       end
+ 
+       context "given a string only containing a major, minor and patch version" do
+         it "returns an array containing 4 elements" do
+-          expect(subject.split("1.2.3")).to have(5).items
++          expect(subject.split("1.2.3").size).to eq(5)
+         end
+ 
+         it "returns nil as fourth element" do
+@@ -243,7 +243,7 @@
+ 
+       context "given a string only containing a major and minor version" do
+         it "returns an array containing 4 elements" do
+-          expect(subject.split("1.2")).to have(3).items
++          expect(subject.split("1.2").size).to eq(3)
+         end
+ 
+         it "returns 0 as the third element" do
+@@ -257,7 +257,7 @@
+ 
+       context "given a string with only a major version" do
+         it "returns an array containing 3 elements" do
+-          expect(subject.split("1")).to have(3).items
++          expect(subject.split("1").size).to eq(3)
+         end
+ 
+         it "returns 0 as the second element" do
+
+From 3681573bcebb60d69a115d76790ac800e8a00648 Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:08:58 -0800
+Subject: [PATCH 3/7] Change "be_true" expectations to "be true"
+
+---
+ spec/unit/semverse/constraint_spec.rb | 2 +-
+ spec/unit/semverse/version_spec.rb    | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/spec/unit/semverse/constraint_spec.rb b/spec/unit/semverse/constraint_spec.rb
+index a0c1c0e..9f37e6c 100644
+--- a/spec/unit/semverse/constraint_spec.rb
++++ b/spec/unit/semverse/constraint_spec.rb
+@@ -2,7 +2,7 @@
+ 
+ RSpec::Matchers.define :satisfies do |*args|
+   match do |constraint|
+-    constraint.satisfies?(*args).should be_true
++    constraint.satisfies?(*args).should be true
+   end
+ end
+ 
+diff --git a/spec/unit/semverse/version_spec.rb b/spec/unit/semverse/version_spec.rb
+index 411d512..f5dac74 100644
+--- a/spec/unit/semverse/version_spec.rb
++++ b/spec/unit/semverse/version_spec.rb
+@@ -300,7 +300,7 @@
+   describe "#pre_release?" do
+     context "when a pre-release value is set" do
+       subject { described_class.new("1.2.3-alpha").pre_release? }
+-      it { should be_true }
++      it { should be true }
+     end
+ 
+     context "when no pre-release value is set" do
+@@ -312,7 +312,7 @@
+   describe "#zero?" do
+     context "major, minor and patch are equal to 0" do
+       subject { described_class.new("0.0.0").zero? }
+-      it { should be_true }
++      it { should be true }
+     end
+ 
+     context "major is not equal to 0" do
+
+From d886fc8121d1bec92b10e2b48949ed67c4386899 Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:13:11 -0800
+Subject: [PATCH 4/7] Change "be_false" matcher syntax to "be false"
+
+---
+ spec/unit/semverse/version_spec.rb | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/spec/unit/semverse/version_spec.rb b/spec/unit/semverse/version_spec.rb
+index f5dac74..c969501 100644
+--- a/spec/unit/semverse/version_spec.rb
++++ b/spec/unit/semverse/version_spec.rb
+@@ -305,7 +305,7 @@
+ 
+     context "when no pre-release value is set" do
+       subject { described_class.new("1.2.3").pre_release? }
+-      it { should be_false }
++      it { should be false }
+     end
+   end
+ 
+@@ -317,17 +317,17 @@
+ 
+     context "major is not equal to 0" do
+       subject { described_class.new("1.0.0").zero? }
+-      it { should be_false }
++      it { should be false }
+     end
+ 
+     context "minor is not equal to 0" do
+       subject { described_class.new("0.1.0").zero? }
+-      it { should be_false }
++      it { should be false }
+     end
+ 
+     context "patch is not equal to 0" do
+       subject { described_class.new("0.0.1").zero? }
+-      it { should be_false }
++      it { should be false }
+     end
+   end
+ 
+
+From 02ba7bf84debcd0b51248c144281b0599b19ac8c Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:19:21 -0800
+Subject: [PATCH 5/7] Require rspec ~> 3.0
+
+---
+ Gemfile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Gemfile b/Gemfile
+index 1ec7d22..48e8b89 100644
+--- a/Gemfile
++++ b/Gemfile
+@@ -25,5 +25,5 @@ end
+ group :test do
+   gem "spork"
+   gem "rake"
+-  gem "rspec", "~> 2.99"
++  gem "rspec", "~> 3.0"
+ end
+
+From 5a42606d249b4d0b6abb5161557465ac10438460 Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 11:17:46 -0800
+Subject: [PATCH 6/7] Remove deprecated
+ "treat_symbols_as_metadata_keys_with_true_values"
+
+This was set to true, which is now the default with RSpec 3.
+---
+ spec/spec_helper.rb | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+index 80b2358..04c58c1 100644
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -11,7 +11,6 @@
+ 
+   RSpec.configure do |config|
+     config.mock_with :rspec
+-    config.treat_symbols_as_metadata_keys_with_true_values = true
+     config.filter_run focus: true
+     config.run_all_when_everything_filtered = true
+ 
+
+From ed82effdbb8e8821faffd5d7464f91296275314a Mon Sep 17 00:00:00 2001
+From: Larry Gilbert <larry at l2g.to>
+Date: Thu, 13 Nov 2014 12:03:45 -0800
+Subject: [PATCH 7/7] Change "should" syntax to "expect" style
+
+This just changes the "shoulds" that raise deprecation warnings.
+---
+ spec/unit/semverse/constraint_spec.rb | 2 +-
+ spec/unit/semverse/version_spec.rb    | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/spec/unit/semverse/constraint_spec.rb b/spec/unit/semverse/constraint_spec.rb
+index 9f37e6c..eb7e7b6 100644
+--- a/spec/unit/semverse/constraint_spec.rb
++++ b/spec/unit/semverse/constraint_spec.rb
+@@ -2,7 +2,7 @@
+ 
+ RSpec::Matchers.define :satisfies do |*args|
+   match do |constraint|
+-    constraint.satisfies?(*args).should be true
++    expect(constraint.satisfies?(*args)).to be true
+   end
+ end
+ 
+diff --git a/spec/unit/semverse/version_spec.rb b/spec/unit/semverse/version_spec.rb
+index c969501..a580abe 100644
+--- a/spec/unit/semverse/version_spec.rb
++++ b/spec/unit/semverse/version_spec.rb
+@@ -284,13 +284,13 @@
+     describe "::coerce" do
+ 
+       it "coerces a String to a Version object" do
+-        subject.coerce("1.0.0").should eql(subject.new("1.0.0"))
++        expect(subject.coerce("1.0.0")).to eql(subject.new("1.0.0"))
+       end
+ 
+       it "returns an object of the desired class without any additional processing" do
+         version = subject.new("1.0.0")
+         # we want object equality here to prove that the exact object was returned
+-        subject.coerce(version).should equal(version)
++        expect(subject.coerce(version)).to equal(version)
+       end
+ 
+     end
+@@ -335,7 +335,7 @@
+     subject { Semverse::Version.new("1.0.0-rc.1+build.1") }
+ 
+     it "returns a string containing the major.minor.patch-pre_release+build" do
+-      subject.to_s.should eq("1.0.0-rc.1+build.1")
++      expect(subject.to_s).to eq("1.0.0-rc.1+build.1")
+     end
+   end
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0e166c2..3e80256 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_disable_bundler_and_rubygems.diff
+rspec3.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-semverse.git



More information about the Pkg-ruby-extras-commits mailing list