[SCM] ci-tooling packaging branch, master, updated. 697d07461388f26c46fbbd30414ccbbe0a8eb794
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Thu Mar 5 13:16:29 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=36539c1
The following commit has been merged in the master branch:
commit 36539c15d148db7174eba5a61fe138c4ed93e5d3
Author: Harald Sitter <sitter at kde.org>
Date: Thu Mar 5 14:10:51 2015 +0100
make assert_system const based instead of copy things all over the place
---
test/lib/assert_system.rb | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/test/lib/assert_system.rb b/test/lib/assert_system.rb
index 096c4a1..ccf3376 100644
--- a/test/lib/assert_system.rb
+++ b/test/lib/assert_system.rb
@@ -2,16 +2,20 @@
module AssertSystem
module_function
+ SETUP_BACKUP = :setup_system
+ ASSERT_BACKUP = :__system_orig
+ METHOD = :system
+
# TestUnit prepend to force alias diversion making #{Kernel.system} noop
def setup
- Kernel.send(:alias_method, :system_setup, :system)
- Kernel.send(:define_method, :system) { |*_a| }
+ Kernel.send(:alias_method, SETUP_BACKUP, METHOD)
+ Kernel.send(:define_method, METHOD) { |*_a| }
end
# TestUnit prepend to remove alias diversion making #{Kernel.system} noop
def teardown
- Kernel.send(:alias_method, :system, :system_setup)
- Kernel.send(:undef_method, :system_setup)
+ Kernel.send(:alias_method, METHOD, SETUP_BACKUP)
+ Kernel.send(:undef_method, SETUP_BACKUP)
end
# Assert that a specific system call is made. The call itself is not made.
@@ -21,13 +25,13 @@ module AssertSystem
# @return [Object] return value of block
def assert_system(args, &block)
assertee = self
- Kernel.send(:alias_method, :system_orig, :system)
- Kernel.send(:define_method, :system) do |*a|
+ Kernel.send(:alias_method, ASSERT_BACKUP, METHOD)
+ Kernel.send(:define_method, METHOD) do |*a|
assertee.assert_equal([*args], [*a])
end
block.yield
ensure
- Kernel.send(:alias_method, :system, :system_orig)
- Kernel.send(:undef_method, :system_orig)
+ Kernel.send(:alias_method, METHOD, ASSERT_BACKUP)
+ Kernel.send(:undef_method, ASSERT_BACKUP)
end
end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list