aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-12-04 05:48:25 +0000
committerTom Feist <shabble@metavore.org>2010-12-04 05:48:25 +0000
commit25152bc8bf6d2c4feaf211902fc9d6c9f992f274 (patch)
tree51699c14a3a01cdec615c88c2c1f625a1a09f96e
parentuberprompt: have the debug_prompt_changed handler added/removed appropriately (diff)
downloadirssi-scripts-25152bc8bf6d2c4feaf211902fc9d6c9f992f274.tar.gz
irssi-scripts-25152bc8bf6d2c4feaf211902fc9d6c9f992f274.zip
easy_exec: override /script exec with a function to export all of the Irssi::
namespace functions for ease of testing.
-rw-r--r--feature-tests/easy_exec.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/feature-tests/easy_exec.pl b/feature-tests/easy_exec.pl
new file mode 100644
index 0000000..76cd79f
--- /dev/null
+++ b/feature-tests/easy_exec.pl
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+
+use Irssi (@Irssi::EXPORT_OK);
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => '',
+ contact => '',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+Irssi::signal_add_first 'command script exec', \&better_exec;
+
+sub better_exec {
+ my ($args, $serv, $witem) = @_;
+ eval $args;
+ Irssi::signal_stop();
+}