From a92919501cbc6d2eb96f3c3af175a3b20c72f440 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 29 Feb 2016 15:15:55 +0100 Subject: [PATCH] Update rspec dependency to >= 3 --- ...-thor-0.19.1-update-rspec-dependency.patch | 104 ++++++++++++++++++ rubygem-thor.spec | 13 ++- 2 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 rubygem-thor-0.19.1-update-rspec-dependency.patch diff --git a/rubygem-thor-0.19.1-update-rspec-dependency.patch b/rubygem-thor-0.19.1-update-rspec-dependency.patch new file mode 100644 index 0000000..21b274a --- /dev/null +++ b/rubygem-thor-0.19.1-update-rspec-dependency.patch @@ -0,0 +1,104 @@ +From b5f8c410da4ad315a8c45a91fdcd9a4a2cb57d7d Mon Sep 17 00:00:00 2001 +From: Erik Michaels-Ober +Date: Mon, 9 Jun 2014 12:01:27 +0200 +Subject: [PATCH] Update rspec dependency to >= 3 + +--- + Gemfile | 4 ++-- + spec/command_spec.rb | 2 +- + spec/quality_spec.rb | 2 +- + spec/shell/basic_spec.rb | 18 +++++++++--------- + 4 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/spec/command_spec.rb b/spec/command_spec.rb +index b09270d..6e5ad2c 100644 +--- a/spec/command_spec.rb ++++ b/spec/command_spec.rb +@@ -58,7 +58,7 @@ def command(options = {}) + describe "#run" do + it "runs a command by calling a method in the given instance" do + dub = double +- expect(dub).to receive(:can_has).and_return { |*args| args } ++ expect(dub).to receive(:can_has) { |*args| args } + expect(command.run(dub, [1, 2, 3])).to eq([1, 2, 3]) + end + +diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb +index 94f5100..6fa2798 100644 +--- a/spec/quality_spec.rb ++++ b/spec/quality_spec.rb +@@ -39,7 +39,7 @@ def check_for_extra_spaces(filename) + end + + RSpec::Matchers.define :be_well_formed do +- failure_message_for_should do |actual| ++ failure_message do |actual| + actual.join("\n") + end + +diff --git a/spec/shell/basic_spec.rb b/spec/shell/basic_spec.rb +index 417f371..0ca8cf1 100644 +--- a/spec/shell/basic_spec.rb ++++ b/spec/shell/basic_spec.rb +@@ -68,34 +68,34 @@ def shell + describe "#yes?" do + it "asks the user and returns true if the user replies yes" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("y") +- expect(shell.yes?("Should I overwrite it?")).to be_true ++ expect(shell.yes?("Should I overwrite it?")).to be true + end + + it "asks the user and returns false if the user replies no" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("n") +- expect(shell.yes?("Should I overwrite it?")).not_to be_true ++ expect(shell.yes?("Should I overwrite it?")).not_to be true + end + + it "asks the user and returns false if the user replies with an answer other than yes or no" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("foobar") +- expect(shell.yes?("Should I overwrite it?")).to be_false ++ expect(shell.yes?("Should I overwrite it?")).to be false + end + end + + describe "#no?" do + it "asks the user and returns true if the user replies no" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("n") +- expect(shell.no?("Should I overwrite it?")).to be_true ++ expect(shell.no?("Should I overwrite it?")).to be true + end + + it "asks the user and returns false if the user replies yes" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("Yes") +- expect(shell.no?("Should I overwrite it?")).to be_false ++ expect(shell.no?("Should I overwrite it?")).to be false + end + + it "asks the user and returns false if the user replies with an answer other than yes or no" do + expect(Thor::LineEditor).to receive(:readline).with("Should I overwrite it? ", :add_to_history => false).and_return("foobar") +- expect(shell.no?("Should I overwrite it?")).to be_false ++ expect(shell.no?("Should I overwrite it?")).to be false + end + end + +@@ -283,17 +283,17 @@ def #456 Lanç... + + it "returns true if the user chooses default option" do + expect(Thor::LineEditor).to receive(:readline).and_return("") +- expect(shell.file_collision("foo")).to be_true ++ expect(shell.file_collision("foo")).to be true + end + + it "returns false if the user chooses no" do + expect(Thor::LineEditor).to receive(:readline).and_return("n") +- expect(shell.file_collision("foo")).to be_false ++ expect(shell.file_collision("foo")).to be false + end + + it "returns true if the user chooses yes" do + expect(Thor::LineEditor).to receive(:readline).and_return("y") +- expect(shell.file_collision("foo")).to be_true ++ expect(shell.file_collision("foo")).to be true + end + + it "shows help usage if the user chooses help" do diff --git a/rubygem-thor.spec b/rubygem-thor.spec index c532edf..206e017 100644 --- a/rubygem-thor.spec +++ b/rubygem-thor.spec @@ -7,16 +7,18 @@ Summary: Thor is a toolkit for building powerful command-line interfaces Name: rubygem-%{gem_name} Version: 0.19.1 -Release: 3%{?dist} +Release: 4%{?dist} Group: Development/Languages License: MIT URL: http://whatisthor.com/ Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem +# Update rspec dependency to >= 3 +Patch0: rubygem-thor-0.19.1-update-rspec-dependency.patch BuildRequires: rubygems-devel BuildRequires: ruby(release) BuildRequires: ruby %if %{enable_test} > 0 -BuildRequires: rubygem(rspec) < 3 +BuildRequires: rubygem(rspec) >= 3 BuildRequires: rubygem(fakeweb) BuildRequires: git %endif @@ -71,7 +73,9 @@ sed -i '/simplecov/,/end/ s/^/#/' spec/helper.rb mkdir spec/fixtures/doc/components touch spec/fixtures/doc/components/.empty_directory -rspec2 spec +patch -F 0 -p1 < %{PATCH0} + +rspec spec popd %endif @@ -94,6 +98,9 @@ popd %{gem_instdir}/thor.gemspec %changelog +* Mon Feb 29 2016 Pavel Valena - 0.19.1-4 +- Update rspec dependency to >= 3 + * Thu Feb 04 2016 Fedora Release Engineering - 0.19.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild