[DRE-commits] [ruby-filepath] 01/03: Convert specs to RSpec3-compatible syntax (Closes: #795037)
Cédric Boutillier
boutil at moszumanska.debian.org
Thu Aug 13 13:16:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-filepath.
commit 098a64420734388ac38772cf5823a066cdbfede6
Author: Cédric Boutillier <boutil at debian.org>
Date: Thu Aug 13 15:03:59 2015 +0200
Convert specs to RSpec3-compatible syntax (Closes: #795037)
---
debian/patches/0004-RSpec3.patch | 378 +++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 379 insertions(+)
diff --git a/debian/patches/0004-RSpec3.patch b/debian/patches/0004-RSpec3.patch
new file mode 100644
index 0000000..3601843
--- /dev/null
+++ b/debian/patches/0004-RSpec3.patch
@@ -0,0 +1,378 @@
+Description: Add basic RSpec3 support
+Author: Cédric Boutillier <boutil at debian.org>
+Bug-Debian: https://bugs.debian.org/795037
+Forwarded: https://github.com/gioele/filepath/pull/3
+Last-Update: 2015-08-13
+
+--- a/spec/filepath_spec.rb
++++ b/spec/filepath_spec.rb
+@@ -182,7 +182,7 @@
+ ]
+ with_extension.each do |path|
+ it "says that <#{path}> has an extension" do
+- FilePath.new(path).extension?.should be_true
++ FilePath.new(path).extension?.should be true
+ end
+ end
+
+@@ -193,7 +193,7 @@
+ ]
+ no_extension.each do |path|
+ it "says that <#{path}> has no extension" do
+- FilePath.new(path).extension?.should be_false
++ FilePath.new(path).extension?.should be false
+ end
+ end
+
+@@ -205,12 +205,12 @@
+ ]
+ extension_data.each do |path, ext|
+ it "says that <#{path}> extesions is #{ext.inspect}" do
+- FilePath.new(path).extension?(ext).should be_true
++ FilePath.new(path).extension?(ext).should be true
+ end
+ end
+
+ it "says that `foo.bar` extension is not `baz`" do
+- FilePath.new('foo.bar').extension?('baz').should be_false
++ FilePath.new('foo.bar').extension?('baz').should be false
+ end
+ end
+
+@@ -320,7 +320,7 @@
+ steps << seg
+ end
+
+- steps.should have(4).items
++ steps.size.should eq(4)
+ steps[0].should eq("/")
+ steps[1].should eq("a")
+ steps[2].should eq("b")
+@@ -333,7 +333,7 @@
+ steps << seg
+ end
+
+- steps.should have(3).items
++ steps.size.should eq(3)
+ steps[0].should eq("a")
+ steps[1].should eq("b")
+ steps[2].should eq("c")
+@@ -352,7 +352,7 @@
+ steps << seg
+ end
+
+- steps.should have(4).items
++ steps.size.should eq(4)
+ steps[0].should eq("/a/b/c")
+ steps[1].should eq("/a/b")
+ steps[2].should eq("/a")
+@@ -365,7 +365,7 @@
+ steps << seg
+ end
+
+- steps.should have(3).items
++ steps.size.should eq(3)
+ steps[0].should eq("a/b/c")
+ steps[1].should eq("a/b")
+ steps[2].should eq("a")
+@@ -384,7 +384,7 @@
+ steps << seg
+ end
+
+- steps.should have(4).items
++ steps.size.should eq(4)
+ steps[0].should eq("/")
+ steps[1].should eq("/a")
+ steps[2].should eq("/a/b")
+@@ -397,7 +397,7 @@
+ steps << seg
+ end
+
+- steps.should have(3).items
++ steps.size.should eq(3)
+ steps[0].should eq("a")
+ steps[1].should eq("a/b")
+ steps[2].should eq("a/b/c")
+@@ -801,7 +801,7 @@
+ ph.open('w') { |file| file << lines.join("\n") }
+ readlines = ph.readlines
+
+- readlines.should have(3).lines
++ readlines.size.should eq(3)
+ readlines.all? { |l| l.chomp.should == line }
+ end
+
+@@ -811,7 +811,7 @@
+ ph.open('w') { |file| file << lines.join(sep) }
+ readlines = ph.readlines(sep)
+
+- readlines.should have(3).lines
++ readlines.size.should eq(3)
+ readlines[0..-2].all? { |l| l.should == line + sep}
+ readlines.last.should == line
+ end
+@@ -964,68 +964,68 @@
+ it "finds all paths matching a glob string" do
+ list = @root.find('*1')
+
+- list.should have(8).items
++ list.size.should eq(8)
+ list.each { |path| path.should =~ /1/ }
+ end
+
+ it "finds all paths matching a Regex" do
+ list = @root.find(/2/)
+
+- list.should have(6).items
++ list.size.should eq(6)
+ list.each { |path| path.should =~ /2/ }
+ end
+
+ it "finds all paths for which the block returns true" do
+ list = @root.find { |path| path.directory? }
+
+- list.should have(9).items
++ list.size.should eq(9)
+ list.each { |path| path.filename.should =~ /^d/ }
+ end
+ end
+
+ describe "#files" do
+ it "finds 1 file in the root directory" do
+- @root.files.should have(1).item
++ @root.files.size.should eq(1)
+ end
+
+ it "finds 3 files in the root directory and its sub directories" do
+- @root.files(true).should have(3).item
++ @root.files(true).size.should eq(3)
+ end
+
+ it "finds 2 files in directory <d1>" do
+- (@root / 'd1').files.should have(2).items
++ (@root / 'd1').files.size.should eq(2)
+ end
+
+ it "finds no files in directory <d1/d12>" do
+- (@root / 'd1' / 'd12').files.should have(0).items
++ (@root / 'd1' / 'd12').files.size.should eq(0)
+ end
+ end
+
+ describe "#directories" do
+ it "finds 4 directories in the root directory" do
+- @root.directories.should have(4).items
++ @root.directories.size.should eq(4)
+ end
+
+ it "finds 9 directories in the root directory and its sub directories" do
+- @root.directories(true).should have(9).item
++ @root.directories(true).size.should eq(9)
+ end
+
+ it "finds 2 directories in directory <d2>" do
+- (@root / 'd2').directories.should have(2).items
++ (@root / 'd2').directories.size.should eq(2)
+ end
+
+ it "finds no directories in directory <d1/d13>" do
+- (@root / 'd1' / 'd13').directories.should have(0).items
++ (@root / 'd1' / 'd13').directories.size.should eq(0)
+ end
+ end
+
+ describe "#links" do
+ it "finds no links in the root directory" do
+- @root.links.should have(0).items
++ @root.links.size.should be(0)
+ end
+
+ it "finds 1 link in directory <d1>" do
+- (@root / 'd1').links.should have(1).item
++ (@root / 'd1').links.size.should eq(1)
+ end
+ end
+ end
+--- a/spec/filepathlist_spec.rb
++++ b/spec/filepathlist_spec.rb
+@@ -14,7 +14,7 @@
+ paths = %w{a/b c/d e/f}
+ list = FilePathList.new(paths)
+
+- list.should have(3).items
++ list.size.should eq(3)
+ list.each { |path| path.should be_a(FilePath) }
+ end
+
+@@ -22,7 +22,7 @@
+ paths = %w{a/b c/d e/f}.map(&:as_path)
+ list = FilePathList.new(paths)
+
+- list.should have(3).items
++ list.size.should eq(3)
+ list.each { |path| path.should be_a(FilePath) }
+ end
+
+@@ -30,7 +30,7 @@
+ paths = [%w{a b}, %w{c d}, %w{e f}]
+ list = FilePathList.new(paths)
+
+- list.should have(3).items
++ list.size.should eq(3)
+ list.each { |path| path.should be_a(FilePath) }
+ end
+ end
+@@ -49,7 +49,7 @@
+ list2 = FilePathList.new(%w{d e})
+
+ list = list1 + list2
+- list.should have(5).items
++ list.size.should eq(5)
+ list[0].should eq('a')
+ list[1].should eq('b')
+ list[2].should eq('c')
+@@ -63,7 +63,7 @@
+ list1 = FilePathList.new(%w{a/b /a/c e/d})
+ list2 = list1 - %w{a/b e/d}
+
+- list2.should have(1).item
++ list2.size.should eq(1)
+ list2[0].should eq('/a/c')
+ end
+ end
+@@ -73,8 +73,8 @@
+ list1 = FilePathList.new(%w{a/b /c/d})
+ list2 = list1 << "e/f"
+
+- list1.should have(2).items
+- list2.should have(3).items
++ list1.size.should eq(2)
++ list2.size.should eq(3)
+
+ list2[0].should eq('a/b')
+ list2[1].should eq('/c/d')
+@@ -93,7 +93,7 @@
+ all_paths = p1.product(p2).map { |x| x.join('/') }
+
+ list = list1 * list2
+- list.should have(6).items
++ list.size.should eq(6)
+ list.should include(*all_paths)
+ end
+
+@@ -102,7 +102,7 @@
+ p2 = "abc"
+
+ list = FilePathList.new(p1) * p2
+- list.should have(3).items
++ list.size.should eq(3)
+ list.should include(*%w{a/abc b/abc c/abc})
+ end
+
+@@ -111,7 +111,7 @@
+ p2 = FilePath.new("x")
+
+ list = FilePathList.new(p1) * p2
+- list.should have(3).items
++ list.size.should eq(3)
+ list.should include(*%w{a/x b/x c/x})
+ end
+
+@@ -120,7 +120,7 @@
+ p2 = ["1", "2"]
+
+ list = FilePathList.new(p1) * p2
+- list.should have(6).items
++ list.size.should eq(6)
+ list.should include(*%w{a/1 b/1 a/2 b/2 c/1 c/2})
+ end
+ end
+@@ -131,7 +131,7 @@
+ paths = %w{a/b/x1 a/b/x2 a/b/x3}
+ list = FilePathList.new(paths).remove_common_segments
+
+- list.should have(3).items
++ list.size.should eq(3)
+ list.should include(*%w{x1 x2 x3})
+ end
+
+@@ -139,7 +139,7 @@
+ list1 = FilePathList.new(%w{a/b/x1 a/b/c/x2 a/b/d/e/x3})
+ list2 = list1.remove_common_segments
+
+- list2.should have(3).items
++ list2.size.should eq(3)
+ list2.should include(*%w{x1 c/x2 d/e/x3})
+ end
+
+@@ -197,21 +197,21 @@
+ describe "#all?" do
+ it "checks whether a block applies to a list" do
+ ok = list.all? { |path| path.extension? }
+- ok.should be_true
++ ok.should be true
+ end
+ end
+
+ describe "#any?" do
+ it "check whether a block does not apply to any path" do
+ ok = list.any? { |path| path.basename == "a.foo" }
+- ok.should be_true
++ ok.should be true
+ end
+ end
+
+ describe "#none?" do
+ it "check whether a block does not apply to any path" do
+ ok = list.none? { |path| path.absolute? }
+- ok.should be_true
++ ok.should be true
+ end
+ end
+ end
+@@ -224,14 +224,14 @@
+ remaining = list.select(/bar$/)
+
+ remaining.should be_a FilePathList
+- remaining.should have(2).items
++ remaining.size.should eq(2)
+ remaining.each { |path| path.extension.should == 'bar' }
+ end
+
+ it "keeps all the paths for which the block returns true" do
+ remaining = list.select { |ph| ph.extension?('bar') }
+
+- remaining.should have(2).items
++ remaining.size.should eq(2)
+ remaining.each { |ph| ph.extension.should == 'bar' }
+ end
+ end
+@@ -241,7 +241,7 @@
+ remaining = list.exclude(/bar$/)
+
+ remaining.should be_a FilePathList
+- remaining.should have(3).items
++ remaining.size.should eq(3)
+ remaining.each { |path| path.extension.should == 'foo' }
+ end
+
+@@ -249,7 +249,7 @@
+ remaining = list.exclude { |path| path.extension?('bar') }
+
+ remaining.should be_a FilePathList
+- remaining.should have(3).items
++ remaining.size.should eq(3)
+ remaining.each { |path| path.extension.should == 'foo' }
+ end
+ end
+@@ -259,8 +259,8 @@
+ mapped = list.map { |path| path.remove_extension }
+
+ mapped.should be_a FilePathList
+- mapped.should have(list.size).items
+- mapped.each { |path| path.extension?.should be_false }
++ mapped.size.should eq(list.size)
++ mapped.each { |path| path.extension?.should be false }
+ end
+ end
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 62df714..13f9b2c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-Require-RSpec-in-helper.patch
0002-Avoid-requiring-bundler-in-Rakefile.patch
0003-Avoid-readability-test.patch
+0004-RSpec3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-filepath.git
More information about the Pkg-ruby-extras-commits
mailing list