dcadenas-filetesthelper 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 10
4
- :patch: 0
4
+ :patch: 1
@@ -52,9 +52,9 @@ module FileTestHelper
52
52
  return unless files_with_contents
53
53
  files_with_contents.each do |path, file_contents|
54
54
  raise ArguemntError, 'A path is not allowed to start with /' if path =~ /^\//
55
- raise ArgumentError, 'A path is not allowed to contain ..' if path =~ /\.\./
55
+ raise ArgumentError, 'A path is not allowed to contain ..' if path =~ /\.\./
56
56
 
57
- dir, file = path.scan(/(.*[\/])?([^\/]*$)/)[0]
57
+ dir, file = path.scan(/(.*[\/])?([^\/]*$)/)[0]
58
58
  mkpath dir unless(dir.nil? or dir.empty?)
59
59
 
60
60
  unless(file.nil? or file.empty?)
@@ -72,7 +72,7 @@ module FileTestHelper
72
72
  cd base_dir
73
73
  begin
74
74
  files_with_contents.each do |path, file_contents|
75
- remove_dir(path)
75
+ remove_dir(path.split(File::SEPARATOR).first)
76
76
  end
77
77
  ensure
78
78
  cd initial_dir
@@ -103,9 +103,11 @@ describe FileTestHelper do
103
103
  test_file = 'should_persist_after_test.txt'
104
104
  begin
105
105
  `touch #{test_file}`
106
- with_files_in_directory(Dir.pwd, 'somefile.txt' => '') {}
106
+ with_files_in_directory(Dir.pwd, 'dir/somefile.txt' => '', 'anotherfile.txt' => '') {}
107
107
 
108
- File.exist?('somefile.txt').should be_false
108
+ File.exist?('dir/somefile.txt').should be_false
109
+ File.exist?('anotherfile.txt').should be_false
110
+ File.exist?('dir').should be_false
109
111
  File.exist?(test_file).should be_true
110
112
  ensure
111
113
  File.delete(test_file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcadenas-filetesthelper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Daniel Cadenas Ni\xC3\xB3n"