summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2014-12-26 11:19:53 +0900
committerTomoyuki Sahara <[email protected]>2014-12-26 11:19:53 +0900
commita960a6f93184cdf6af839775dbb55022d5fbde8a (patch)
treeefbf6ecffbf7e3b4570319e44bdab7a96f05696e /test
parent3a22166c67f1d495f617f3ece5524dcdc9d2872c (diff)
downloadmruby-a960a6f93184cdf6af839775dbb55022d5fbde8a.tar.gz
mruby-a960a6f93184cdf6af839775dbb55022d5fbde8a.zip
failed to add...
Diffstat (limited to 'test')
-rw-r--r--test/sockettest.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sockettest.c b/test/sockettest.c
new file mode 100644
index 000000000..9161bc3f3
--- /dev/null
+++ b/test/sockettest.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+#include "mruby.h"
+
+mrb_value
+mrb_sockettest_tmppath(mrb_state *mrb, mrb_value klass)
+{
+ return mrb_str_new_cstr(mrb, tempnam(NULL, "mruby-socket"));
+}
+
+void
+mrb_mruby_socket_gem_test(mrb_state* mrb)
+{
+ struct RClass *c = mrb_define_module(mrb, "SocketTest");
+ mrb_define_class_method(mrb, c, "tmppath", mrb_sockettest_tmppath, MRB_ARGS_NONE());
+}