summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 11:54:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-01 11:54:53 +0000
commitc07c33b28a5a3015e995a63ece9d771cae6699d1 (patch)
tree7d4ee4b546cf8d57d04075b1f464ec8181b22720 /test/-ext-
parentf09b772de6d7ce3710a55da99c88ea683f2f8b2b (diff)
file.c: export rb_stat_new
* file.c (stat_new_0): constify. * file.c (rb_stat_new): constify and export. based on a patch by Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/file/test_stat.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/-ext-/file/test_stat.rb b/test/-ext-/file/test_stat.rb
new file mode 100644
index 0000000..b9aa132
--- /dev/null
+++ b/test/-ext-/file/test_stat.rb
@@ -0,0 +1,14 @@
+require 'test/unit'
+require "-test-/file"
+
+class Test_FileStat < Test::Unit::TestCase
+ def test_stat_for_fd
+ st = open(__FILE__) {|f| Bug::File::Stat.for_fd(f.fileno)}
+ assert_equal(File.stat(__FILE__), st)
+ end
+
+ def test_stat_for_path
+ st = Bug::File::Stat.for_path(__FILE__)
+ assert_equal(File.stat(__FILE__), st)
+ end
+end