Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Substitute Pathname to get tests to pass in ruby 1.9.3

  • Loading branch information...
commit dcc2ad6952e334b91f0f044a1f1083c99949d840 1 parent 332735b
@lukaso lukaso authored
Showing with 8 additions and 0 deletions.
  1. +6 −0 lib/fakefs/base.rb
  2. +2 −0  lib/fakefs/safe.rb
View
6 lib/fakefs/base.rb
@@ -2,6 +2,7 @@
RealFileTest = FileTest
RealFileUtils = FileUtils
RealDir = Dir
+RealPathname = Pathname
module FakeFS
def self.activate!
@@ -10,11 +11,14 @@ def self.activate!
remove_const(:File)
remove_const(:FileTest)
remove_const(:FileUtils)
+ remove_const(:Pathname) if RUBY_VERSION >= "1.9.3"
+
const_set(:Dir, FakeFS::Dir)
const_set(:File, FakeFS::File)
const_set(:FileUtils, FakeFS::FileUtils)
const_set(:FileTest, FakeFS::FileTest)
+ const_set(:Pathname, FakeFS::Pathname) if RUBY_VERSION >= "1.9.3"
end
true
end
@@ -25,11 +29,13 @@ def self.deactivate!
remove_const(:File)
remove_const(:FileTest)
remove_const(:FileUtils)
+ remove_const(:Pathname) if RUBY_VERSION >= "1.9.3"
const_set(:Dir, RealDir)
const_set(:File, RealFile)
const_set(:FileTest, RealFileTest)
const_set(:FileUtils, RealFileUtils)
+ const_set(:Pathname, RealPathname) if RUBY_VERSION >= "1.9.3"
end
true
end
View
2  lib/fakefs/safe.rb
@@ -9,3 +9,5 @@
require 'fakefs/file'
require 'fakefs/file_test'
require 'fakefs/dir'
+require 'fakefs/pathname' if RUBY_VERSION >= "1.9.3"
+
Please sign in to comment.
Something went wrong with that request. Please try again.