file_sandbox 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ require 'fileutils'
3
3
  require 'test/unit/assertions'
4
4
 
5
5
  module FileSandbox
6
- VERSION = "0.4"
6
+ VERSION = "0.5"
7
7
 
8
8
  attr_reader :sandbox
9
9
 
@@ -35,12 +35,13 @@ module FileSandbox
35
35
  def setup_sandbox(path = '__sandbox')
36
36
  @sandbox = Sandbox.new(path)
37
37
  @__old_path_for_sandbox = Dir.pwd
38
- Dir.chdir(@sandbox.root)
38
+ sleep(1)
39
+ silence_warnings {Dir.chdir(@sandbox.root)}
39
40
  end
40
41
 
41
42
  def teardown_sandbox
42
43
  if @sandbox
43
- Dir.chdir(@__old_path_for_sandbox)
44
+ silence_warnings {Dir.chdir(@__old_path_for_sandbox)}
44
45
  @sandbox.clean_up
45
46
  @sandbox = nil
46
47
  end
@@ -136,4 +137,13 @@ module FileSandbox
136
137
  alias contents= content=
137
138
  alias binary_contents= binary_content=
138
139
  end
140
+
141
+ private
142
+
143
+ def silence_warnings
144
+ old_verbose, $VERBOSE = $VERBOSE, nil
145
+ yield
146
+ ensure
147
+ $VERBOSE = old_verbose
148
+ end
139
149
  end
@@ -1,4 +1,4 @@
1
- require 'file_sandbox'
1
+ require File.dirname(__FILE__) + '/file_sandbox'
2
2
 
3
3
  module FileSandbox
4
4
  def self.included(spec)
@@ -12,4 +12,4 @@ module FileSandbox
12
12
  teardown_sandbox
13
13
  end
14
14
  end
15
- end
15
+ end
metadata CHANGED
@@ -1,33 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: file_sandbox
5
3
  version: !ruby/object:Gem::Version
6
- version: "0.4"
7
- date: 2007-11-02 00:00:00 -07:00
8
- summary: File sandbox creates a space for your tests to safely hit the file system. It also makes it easier for them to do so. By cleaning up after them.
9
- require_paths:
10
- - lib
11
- email: jeremystellsmith@gmail.com
12
- homepage: http://onemanswalk.com
13
- rubyforge_project: filesandbox
14
- description: File sandbox creates a space for your tests to safely hit the file system. It also makes it easier for them to do so. By cleaning up after them.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: "0.5"
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Jeremy Stell-Smith
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-08-07 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.7.0
24
+ version:
25
+ description: File sandbox creates a space for your tests to safely hit the file system. It also makes it easier for them to do so. By cleaning up after them.
26
+ email: jeremystellsmith@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - CHANGES.txt
33
+ - Manifest.txt
34
+ - README.txt
31
35
  files:
32
36
  - CHANGES.txt
33
37
  - Manifest.txt
@@ -38,28 +42,32 @@ files:
38
42
  - lib/file_sandbox.rb
39
43
  - lib/file_sandbox_behavior.rb
40
44
  - test/file_sandbox_test.rb
41
- test_files: []
42
-
45
+ has_rdoc: true
46
+ homepage: http://onemanswalk.com
47
+ post_install_message:
43
48
  rdoc_options:
44
49
  - --main
45
50
  - README.txt
46
- extra_rdoc_files:
47
- - CHANGES.txt
48
- - Manifest.txt
49
- - README.txt
50
- executables: []
51
-
52
- extensions: []
53
-
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
54
65
  requirements: []
55
66
 
56
- dependencies:
57
- - !ruby/object:Gem::Dependency
58
- name: hoe
59
- version_requirement:
60
- version_requirements: !ruby/object:Gem::Version::Requirement
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 1.3.0
65
- version:
67
+ rubyforge_project: filesandbox
68
+ rubygems_version: 1.2.0
69
+ signing_key:
70
+ specification_version: 2
71
+ summary: File sandbox creates a space for your tests to safely hit the file system. It also makes it easier for them to do so. By cleaning up after them.
72
+ test_files: []
73
+