diff options
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | test/io.rb | 6 | ||||
| -rw-r--r-- | test/mruby_io_test.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ffe227284 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +script: + - "ruby run_test.rb all test" diff --git a/test/io.rb b/test/io.rb index 02507a9d4..99f236fb4 100644 --- a/test/io.rb +++ b/test/io.rb @@ -51,15 +51,15 @@ assert('IO.sysopen, IO#close, IO#closed?') do assert_equal true, io.closed?, "IO#closed? should return true" end -assert('IO.sysopen("/nonexistent")') do +assert('IO.sysopen("./nonexistent")') do if Object.const_defined? :Errno eclass = Errno::ENOENT else eclass = RuntimeError end assert_raise eclass do - fd = IO.sysopen "/nonexistent" - IO.close fd + fd = IO.sysopen "./nonexistent" + IO._sysclose fd end end diff --git a/test/mruby_io_test.c b/test/mruby_io_test.c index 6a3b20f62..36e56b87c 100644 --- a/test/mruby_io_test.c +++ b/test/mruby_io_test.c @@ -112,7 +112,9 @@ static mrb_value mrb_io_test_file_setup(mrb_state *mrb, mrb_value self) { mrb_value ary = mrb_io_test_io_setup(mrb, self); - symlink("/usr/bin", "test-bin"); + if (symlink("/usr/bin", "test-bin") == -1) { + mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a symbolic link"); + } return ary; } |
