[DRE-commits] [ruby-net-ldap] 01/02: Apply patch to actually mock TCPSocket in the connection failure test
zeha at debian.org
zeha at debian.org
Fri Apr 21 07:55:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
zeha pushed a commit to branch master
in repository ruby-net-ldap.
commit 06b51d33d76ca723c4f892ad74d3ea41958bf3fb
Author: Christian Hofstaedtler <zeha at debian.org>
Date: Fri Apr 21 07:49:55 2017 +0000
Apply patch to actually mock TCPSocket in the connection failure test
Closes: #860602
---
debian/patches/series | 1 +
debian/patches/test-actually-mock.patch | 12 ++++++++++++
test/test_ldap_connection.rb | 1 +
3 files changed, 14 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..386155e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+test-actually-mock.patch
diff --git a/debian/patches/test-actually-mock.patch b/debian/patches/test-actually-mock.patch
new file mode 100644
index 0000000..7d4dc80
--- /dev/null
+++ b/debian/patches/test-actually-mock.patch
@@ -0,0 +1,12 @@
+Index: ruby-net-ldap/test/test_ldap_connection.rb
+===================================================================
+--- ruby-net-ldap.orig/test/test_ldap_connection.rb
++++ ruby-net-ldap/test/test_ldap_connection.rb
+@@ -61,6 +61,7 @@ class TestLDAPConnection < Test::Unit::T
+ end
+
+ def test_unresponsive_host
++ flexmock(TCPSocket).should_receive(:new).and_raise(Errno::ETIMEDOUT)
+ assert_raise Net::LDAP::Error do
+ Net::LDAP::Connection.new(:host => 'test.mocked.com', :port => 636)
+ end
diff --git a/test/test_ldap_connection.rb b/test/test_ldap_connection.rb
index b4c7761..fd7c93e 100644
--- a/test/test_ldap_connection.rb
+++ b/test/test_ldap_connection.rb
@@ -61,6 +61,7 @@ class TestLDAPConnection < Test::Unit::TestCase
end
def test_unresponsive_host
+ flexmock(TCPSocket).should_receive(:new).and_raise(Errno::ETIMEDOUT)
assert_raise Net::LDAP::Error do
Net::LDAP::Connection.new(:host => 'test.mocked.com', :port => 636)
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-net-ldap.git
More information about the Pkg-ruby-extras-commits
mailing list