fakefs 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTIzY2Q2ZDAyZTJlNGQ5ODc4NDM1ODY1OGM0YThhNDRjYWNjOWQ0OQ==
4
+ NjUzOTNkOTM3NDJkNmJjOGRmYTcwYjE3NWY4MzA4NzMxMTMzN2UzYw==
5
5
  data.tar.gz: !binary |-
6
- MzU3YWZlYzg4MmE5ZDg2ZGI0NzE4ZjNhZDZjYTgzMDZhZjQ3Y2Q4YQ==
6
+ YTM0ZTA4YjA3ZDBkZjRlNTRmOGExNzc2NzkyMWYyYWVmODMyMjI0Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzcxODdlNzE1MzBiOTM5MDM0MWZjNDA1YTc1MDNjN2E2ZmU3NmM0MmQ0ZGNh
10
- OTY5N2NhYjFhZGFlZDk4YzY2OTU1OTRhZjA2OTc1NTA0NzMwNDMzNTUwNDcx
11
- NzkxOTczYTcxMDcwNmViYTQ0Y2RiMDQzNTBjMzUxMjU5ODFmOGI=
9
+ YjlkMGY3OWVjNWVhZjIzMjEyZDNhZDYzOTQ0ODNiNmUyMDg2ODI2N2Q2MTNm
10
+ YTZlM2Q3MmI3Njg0ZGE2MWZmY2I5NGRhNWY1ZmE0NGNkMDVlZDkzNThiMjFk
11
+ YTRkNzNlMmExMTk4Nzg2ZTRhMTEzMDZiYWFmZjUxYTQ5MTI4MzE=
12
12
  data.tar.gz: !binary |-
13
- OWFjNTJlZGI2Y2FiN2ViZGE4YjM0MDU0MTRlN2FhNDRkNDgwMGEwOGQ0MzBm
14
- YjhlMjdkYTAxN2Y3YTc2NmVlMWYwNjNhYTExMmUwYTYxZmRiNWU3ZmUyYWM5
15
- NjE2YjQxNGM1YmFiNWVjZDAyZjM1YjA4NDE4MTNmMGI4MWFjY2U=
13
+ ZDc2Y2ZkYzA2YWE4NDQ3MTBhYTFmMmI3NmEwZTUwZjlkMzZmNzhmMzQ4ZTIy
14
+ MDA1ZTlhNDJhMDYxZWNlMDg0NTRiNTljMmU5OTAzMTAxYTNhMzE4NGMyYjU2
15
+ M2MyZTc5OTMzNzU2NjcyODUyMDk3ZDc2MjQ4NWYyNTk1ZWE4MTg=
data/README.markdown CHANGED
@@ -59,7 +59,8 @@ end
59
59
  Rails
60
60
  -----
61
61
 
62
- If you are using fakefs in a rails project with bundler, you'll probably want to specify the following in your Gemfile:
62
+ If you are using fakefs in a rails project with bundler, you'll probably want
63
+ to specify the following in your Gemfile:
63
64
 
64
65
  ``` ruby
65
66
  gem "fakefs", :require => "fakefs/safe"
@@ -116,6 +117,15 @@ FakeFS internally uses the `Pathname` and `FileUtils` constants. If you use
116
117
  these in your app, be certain you're properly requiring them and not counting
117
118
  on FakeFS' own require.
118
119
 
120
+ As of v0.5.0, FakeFS's current working directory (i.e. `Dir.pwd`) is
121
+ independent of the real working directory. Previously if the real working
122
+ directory were, for example, `/Users/donovan/Desktop`, then FakeFS would use
123
+ that as the fake working directory too, even though it most likely didn't
124
+ exist. This caused all kinds of subtle bugs. Now the default working directory
125
+ is the only thing that is guaranteed to exist, namely the root (i.e. `/`). This
126
+ may be important when upgrading from v0.4.x to v0.5.x, especially if you depend
127
+ on the real working directory while using FakeFS.
128
+
119
129
 
120
130
  Speed?
121
131
  ------
data/lib/fakefs/base.rb CHANGED
@@ -4,6 +4,16 @@ RealFileUtils = FileUtils
4
4
  RealDir = Dir
5
5
  RealPathname = Pathname
6
6
 
7
+ def RealPathname(*args)
8
+ RealPathname.new(*args)
9
+ end
10
+
11
+ if RUBY_VERSION >= "1.9.3"
12
+ def Pathname(*args)
13
+ Pathname.new(*args)
14
+ end
15
+ end
16
+
7
17
  module FakeFS
8
18
  @activated = false
9
19
  class << self
@@ -1,6 +1,6 @@
1
1
  module FakeFS
2
2
  module Version
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
 
5
5
  def self.to_s
6
6
  VERSION
data/test/fakefs_test.rb CHANGED
@@ -2330,6 +2330,11 @@ class FakeFSTest < Test::Unit::TestCase
2330
2330
  assert !Pathname.new("bar").exist?
2331
2331
  end
2332
2332
 
2333
+ def test_pathname_method_is_faked
2334
+ FileUtils.mkdir_p '/path'
2335
+ assert Pathname('/path').exist?, 'Pathname() method is faked'
2336
+ end
2337
+
2333
2338
  def test_dir_mktmpdir
2334
2339
  FileUtils.mkdir '/tmp'
2335
2340
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakefs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-01-07 00:00:00.000000000 Z
15
+ date: 2014-03-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -158,4 +158,3 @@ test_files:
158
158
  - test/safe_test.rb
159
159
  - test/test_helper.rb
160
160
  - test/verify.rb
161
- has_rdoc: