diff --git a/lib/fakefs/file.rb b/lib/fakefs/file.rb index 01931c6..3c42208 100644 --- a/lib/fakefs/file.rb +++ b/lib/fakefs/file.rb @@ -358,7 +358,7 @@ module FakeFS end def to_path - raise NotImplementedError + @path end end diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index cc0041c..732c1d2 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -1663,5 +1663,11 @@ class FakeFSTest < Test::Unit::TestCase assert_equal false, f.autoclose? end end + + def test_to_path + File.new("foo", 'w') do |f| + assert_equal "foo", f.to_path + end + end end end