[DRE-commits] [yard] 04/05: Add relax_specs_for_0_9_5.patch to fix specs
Cédric Boutillier
boutil at moszumanska.debian.org
Tue Aug 2 15:20:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository yard.
commit 741a2c560761bd93db14846b64a8654379bd5525
Author: Cédric Boutillier <boutil at debian.org>
Date: Tue Aug 2 17:12:37 2016 +0200
Add relax_specs_for_0_9_5.patch to fix specs
---
debian/patches/relax_specs_for_0_9_5.patch | 135 +++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 136 insertions(+)
diff --git a/debian/patches/relax_specs_for_0_9_5.patch b/debian/patches/relax_specs_for_0_9_5.patch
new file mode 100644
index 0000000..626f25d
--- /dev/null
+++ b/debian/patches/relax_specs_for_0_9_5.patch
@@ -0,0 +1,135 @@
+Description: amke specs less strict
+ To be dropped after the release of 0.9.6
+Author: Loren Segal <lsegal at soen.ca>
+Origin: upstream
+Last-Update: 2016-08-02
+
+--- a/spec/cli/server_spec.rb
++++ b/spec/cli/server_spec.rb
+@@ -119,6 +119,7 @@
+ end
+
+ it "defaults to .yardoc if no library is specified" do
++ allow(Dir).to receive(:chdir).and_yield
+ expect(Dir).to receive(:pwd).at_least(:once).and_return(File.expand_path('/path/to/foo'))
+ @libraries['foo'] = [Server::LibraryVersion.new('foo', nil, File.expand_path('/path/to/foo/.yardoc'))]
+ run
+--- a/spec/registry_spec.rb
++++ b/spec/registry_spec.rb
+@@ -17,67 +17,69 @@
+ end
+
+ it "returns nil if gem isn't found" do
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([])
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([])
+ expect(Registry.yardoc_file_for_gem('foo')).to eq nil
+ end
+
+ it "allows version to be specified" do
+- expect(Gem.source_index).to receive(:find_name).with('foo', '= 2').and_return([])
++ allow(Gem.source_index).to receive(:find_name).with('foo', '= 2').and_return([])
+ expect(Registry.yardoc_file_for_gem('foo', '= 2')).to eq nil
+ end
+
+ it "returns existing .yardoc path for gem when for_writing=false" do
+- expect(File).to receive(:exist?).twice.and_return(false)
+- expect(File).to receive(:exist?).with('/path/to/foo/.yardoc').and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).twice.and_return(false)
++ allow(File).to receive(:exist?).with('/path/to/foo/.yardoc').and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo')).to eq '/path/to/foo/.yardoc'
+ end
+
+ it "returns new existing .yardoc path for gem when for_writing=false" do
+- expect(File).to receive(:exist?).once.and_return(false)
+- expect(File).to receive(:exist?).with('/path/to/foo/doc/.yardoc').and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).and_return(false)
++ allow(File).to receive(:exist?).with('/path/to/foo/doc/.yardoc').and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo')).to eq '/path/to/foo/doc/.yardoc'
+ end
+
+ it "returns nil if no .yardoc path exists in gem when for_writing=false" do
+- expect(File).to receive(:exist?).twice.and_return(false)
+- expect(File).to receive(:exist?).with('/path/to/foo/.yardoc').and_return(false)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).twice.and_return(false)
++ allow(File).to receive(:exist?).with('/path/to/foo/.yardoc').and_return(false)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo')).to eq nil
+ end
+
+ it "searches local gem path first if for_writing=false" do
+- expect(File).to receive(:exist?).and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo')).to match %r{/.yard/gem_index/foo-1.0.yardoc$}
+ end
+
+ it "returns global .yardoc path for gem if for_writing=true and dir is writable" do
+- expect(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
+- expect(File).to receive(:writable?).with(@gem.full_gem_path).and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).and_return(false)
++ allow(File).to receive(:directory?).with(@gem.doc_dir).and_return(true)
++ allow(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
++ allow(File).to receive(:writable?).with(@gem.full_gem_path).and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo', '>= 0', true)).to eq '/path/to/foo/.yardoc'
+ end
+
+ it "returns new global .yardoc path for gem if for_writing=true and dir is writable" do
+- expect(File).to receive(:writable?).with(@gem.doc_dir).and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:writable?).with(@gem.doc_dir).and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo', '>= 0', true)).to eq '/path/to/foo/doc/.yardoc'
+ end
+
+ it "returns new global .yardoc path for gem if for_writing=true and parent dir is writable (but dir does not exist)" do
+- expect(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
+- expect(File).to receive(:directory?).with(@gem.doc_dir).and_return(false)
+- expect(File).to receive(:writable?).with(File.dirname(@gem.doc_dir)).and_return(true)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
++ allow(File).to receive(:directory?).with(@gem.doc_dir).and_return(false)
++ allow(File).to receive(:writable?).with(File.dirname(@gem.doc_dir)).and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo', '>= 0', true)).to eq '/path/to/foo/doc/.yardoc'
+ end
+
+ it "returns local .yardoc path for gem if for_writing=true and dir is not writable" do
+- expect(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
+- expect(File).to receive(:writable?).with(@gem.full_gem_path).and_return(false)
+- expect(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
++ allow(File).to receive(:writable?).with(@gem.doc_dir).and_return(false)
++ allow(File).to receive(:writable?).with(@gem.full_gem_path).and_return(false)
++ allow(Gem.source_index).to receive(:find_name).with('foo', '>= 0').and_return([@gem])
+ expect(Registry.yardoc_file_for_gem('foo', '>= 0', true)).to match %r{/.yard/gem_index/foo-1.0.yardoc$}
+ end
+
+@@ -85,8 +87,8 @@
+ allow(@gem).to receive(:name).and_return('yard-doc-core')
+ allow(@gem).to receive(:full_name).and_return('yard-doc-core-1.0')
+ allow(@gem).to receive(:full_gem_path).and_return('/path/to/yard-doc-core')
+- expect(Gem.source_index).to receive(:find_name).with('yard-doc-core', '>= 0').and_return([@gem])
+- expect(File).to receive(:exist?).with('/path/to/yard-doc-core/.yardoc').and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('yard-doc-core', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).with('/path/to/yard-doc-core/.yardoc').and_return(true)
+ expect(Registry.yardoc_file_for_gem('yard-doc-core')).to eq '/path/to/yard-doc-core/.yardoc'
+ end
+
+@@ -94,8 +96,8 @@
+ allow(@gem).to receive(:name).and_return('yard-doc-core')
+ allow(@gem).to receive(:full_name).and_return('yard-doc-core-1.0')
+ allow(@gem).to receive(:full_gem_path).and_return('/path/to/yard-doc-core')
+- expect(Gem.source_index).to receive(:find_name).with('yard-doc-core', '>= 0').and_return([@gem])
+- expect(File).to receive(:exist?).with('/path/to/yard-doc-core/.yardoc').and_return(true)
++ allow(Gem.source_index).to receive(:find_name).with('yard-doc-core', '>= 0').and_return([@gem])
++ allow(File).to receive(:exist?).with('/path/to/yard-doc-core/.yardoc').and_return(true)
+ expect(Registry.yardoc_file_for_gem('yard-doc-core', '>= 0', true)).to eq nil
+ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 8b0551f..d50bf9f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+relax_specs_for_0_9_5.patch
require-in-executables.patch
set-templates-path.patch
remove_rubygems_and_path_manipulation_from_spec.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/yard.git
More information about the Pkg-ruby-extras-commits
mailing list