[DRE-commits] [ruby-packetfu] 03/06: add patches for rspec3
Cédric Boutillier
boutil at moszumanska.debian.org
Sun Aug 9 23:30:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-packetfu.
commit dbd47e835614348cd01307b242da83761ae3654e
Author: Cédric Boutillier <boutil at debian.org>
Date: Mon Aug 10 01:08:50 2015 +0200
add patches for rspec3
---
debian/patches/0004-Port-to-rspec3.patch | 108 ++++++++++++++++++++++++++++
debian/patches/0005-Require-rspec-its.patch | 18 +++++
debian/patches/series | 2 +
3 files changed, 128 insertions(+)
diff --git a/debian/patches/0004-Port-to-rspec3.patch b/debian/patches/0004-Port-to-rspec3.patch
new file mode 100644
index 0000000..49a64f1
--- /dev/null
+++ b/debian/patches/0004-Port-to-rspec3.patch
@@ -0,0 +1,108 @@
+Description: Update spec files to make them run with ruby 2.x and rspec 3
+ - updated to fit the released version of the code
+Origin: https://github.com/packetfu/packetfu/pull/66
+From: Sylvain Daubert <sylvain.daubert at laposte.net>
+Reviewed-by: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2015-08-09
+
+--- a/spec/structfu_spec.rb
++++ b/spec/structfu_spec.rb
+@@ -11,10 +11,10 @@
+ end
+
+ it "should provide the basic StructFu methods" do
+- @sc.respond_to?(:sz).should be_true
+- @sc.respond_to?(:len).should be_true
+- @sc.respond_to?(:typecast).should be_true
+- @sc.respond_to?(:body=).should be_true
++ @sc.respond_to?(:sz).should be true
++ @sc.respond_to?(:len).should be true
++ @sc.respond_to?(:typecast).should be true
++ @sc.respond_to?(:body=).should be true
+ end
+ end
+
+--- a/packetfu.gemspec
++++ b/packetfu.gemspec
+@@ -13,7 +13,8 @@
+ s.license = 'BSD'
+
+ s.add_development_dependency('pcaprub', '>= 0.9.2')
+- s.add_development_dependency('rspec', '>= 2.6.2')
++ s.add_development_dependency('rspec', '>= 2.14.1')
++ s.add_development_dependency('rspec-its', '>= 1.0.0')
+ s.add_development_dependency('sdoc', '>= 0.2.0')
+
+ s.extra_rdoc_files = %w[.document README.rdoc]
+--- a/spec/packet_subclasses_spec.rb
++++ b/spec/packet_subclasses_spec.rb
+@@ -1,11 +1,12 @@
+ $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), "..", "lib")
++require 'rspec/its'
+ require 'packetfu'
+
+ PacketFu.packet_classes.each do |pclass|
+ describe pclass, "peek format" do
+ it "will display sensible peek information" do
+ p = pclass.new
+- p.respond_to?(:peek).should be_true
++ p.respond_to?(:peek).should be true
+ p.peek.size.should be <= 80, p.peek.inspect
+ p.peek.should match(/^[A-Z0-9?]../)
+ end
+--- a/spec/packetfu_spec.rb
++++ b/spec/packetfu_spec.rb
+@@ -10,15 +11,15 @@
+ it "can compare version strings" do
+ PacketFu.binarize_version("1.2.3").should == 0x010203
+ PacketFu.binarize_version("3.0").should == 0x030000
+- PacketFu.at_least?("1.0").should be_true
+- PacketFu.at_least?("4.0").should be_false
+- PacketFu.older_than?("4.0").should be_true
+- PacketFu.newer_than?("1.0").should be_true
++ PacketFu.at_least?("1.0").should be true
++ PacketFu.at_least?("4.0").should be false
++ PacketFu.older_than?("4.0").should be true
++ PacketFu.newer_than?("1.0").should be true
+ end
+
+ it "can handle .pre versions" do
+ PacketFu.binarize_version("1.7.6.pre").should == 0x010706
+- PacketFu.at_least?("0.9.0.pre").should be_true
++ PacketFu.at_least?("0.9.0.pre").should be true
+ end
+ end
+
+@@ -38,9 +39,9 @@
+ rescue LoadError
+ end
+ if has_pcap
+- PacketFu.instance_variable_get(:@pcaprub_loaded).should be_true
++ PacketFu.instance_variable_get(:@pcaprub_loaded).should be true
+ else
+- PacketFu.instance_variable_get(:@pcaprub_loaded).should be_false
++ PacketFu.instance_variable_get(:@pcaprub_loaded).should be false
+ end
+ end
+ end
+--- a/spec/packet_spec.rb
++++ b/spec/packet_spec.rb
+@@ -13,8 +14,8 @@
+ end
+
+ it "should allow subclasses to instantiate" do
+- expect { PacketFu::FooPacket.new }. to be
+- PacketFu.packet_classes.include?(PacketFu::FooPacket).should be_true
++ expect(PacketFu::FooPacket.new).to be
++ PacketFu.packet_classes.include?(PacketFu::FooPacket).should be true
+ end
+
+ it "should register packet classes with PacketFu" do
+@@ -27,7 +28,7 @@
+ class PacketFu::PacketNot < PacketFu::Packet
+ end
+ }.to raise_error
+- PacketFu.packet_classes.include?(PacketFu::PacketNot).should be_false
++ PacketFu.packet_classes.include?(PacketFu::PacketNot).should be false
+ PacketFu.packet_classes {should_not include(PacketNot) }
+ end
diff --git a/debian/patches/0005-Require-rspec-its.patch b/debian/patches/0005-Require-rspec-its.patch
new file mode 100644
index 0000000..52d500e
--- /dev/null
+++ b/debian/patches/0005-Require-rspec-its.patch
@@ -0,0 +1,18 @@
+Description: explicitly require rspec/its
+Bug-Debian: https://bugs.debian.org/795044
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2015-08-10
+
+--- a/Rakefile
++++ b/Rakefile
+@@ -4,7 +4,9 @@
+ rescue LoadError
+ $stderr.puts "rspec not available, so can't set up spec tasks."
+ else
+- RSpec::Core::RakeTask.new
++ RSpec::Core::RakeTask.new do |spec|
++ spec.ruby_opts = "-rrspec/its"
++ end
+
+ task :default => :spec
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 92e09d2..5061174 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
0001-Be-better-about-version-checking-multidigits.patch
0002-Do-not-require-rubygems-even-with-Ruby-1.8.patch
0003-Fix-encoding-issues-in-specs-for-Ruby-2.x.patch
+0004-Port-to-rspec3.patch
+0005-Require-rspec-its.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-packetfu.git
More information about the Pkg-ruby-extras-commits
mailing list