given_filesystem 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/given_filesystem.gemspec +1 -1
- data/lib/given_filesystem.rb +5 -2
- data/spec/data/hello/world +1 -0
- data/spec/given_filesystem_spec.rb +11 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a37adf41c7d8b7794308031e8b4a8ea85fef4f93
|
4
|
+
data.tar.gz: 0bbe94f7a57c0f418b8a5f321047e95f50e7ff03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be97672d47aee8a66d4cd06b6e649fc1a67cc95414841de7d6c6abc0c9cba0011ac83dbb312002b37fb2773193036389dc5180e9f827c85a3f41241fc6327971
|
7
|
+
data.tar.gz: edfb0e6c40550d33ea19bc4ca0ffe718cdc05050e2e954da38aaac0a5bb50a3e2bd40a4addf89911e087790a28af8c34246102538950b5ee62bad12610a38013
|
data/given_filesystem.gemspec
CHANGED
data/lib/given_filesystem.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2014 Cornelius Schumacher <schumacher@kde.org>
|
1
|
+
# Copyright (c) 2014-2015 Cornelius Schumacher <schumacher@kde.org>
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -54,8 +54,11 @@ class GivenFilesystem
|
|
54
54
|
|
55
55
|
FileUtils.mkdir_p path
|
56
56
|
@path_elements.push to
|
57
|
+
|
58
|
+
created_path = path
|
57
59
|
FileUtils.cp_r test_data_path(from), path
|
58
|
-
|
60
|
+
@path_elements.pop
|
61
|
+
created_path
|
59
62
|
end
|
60
63
|
|
61
64
|
def file file_name = nil, options = {}
|
@@ -0,0 +1 @@
|
|
1
|
+
world
|
@@ -67,7 +67,7 @@ describe GivenFilesystem do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
it "throws error on invalid test data file name" do
|
70
|
-
expect{@given.file "def", :from => "invalidname"}.to raise_error
|
70
|
+
expect{@given.file "def", :from => "invalidname"}.to raise_error /invalidname/
|
71
71
|
end
|
72
72
|
|
73
73
|
it "creates file with content" do
|
@@ -100,6 +100,16 @@ describe GivenFilesystem do
|
|
100
100
|
expect( File.exists? File.join(path,"two","third")).to be(true)
|
101
101
|
end
|
102
102
|
|
103
|
+
it "creates flat sub directories with data" do
|
104
|
+
path = @given.directory do
|
105
|
+
@given.directory_from_data "welcome"
|
106
|
+
@given.directory_from_data "hello"
|
107
|
+
end
|
108
|
+
|
109
|
+
expect(File.directory? File.join(path,"welcome")).to be(true)
|
110
|
+
expect(File.directory? File.join(path,"hello")).to be(true)
|
111
|
+
end
|
112
|
+
|
103
113
|
it "creates directory from data" do
|
104
114
|
path = @given.directory_from_data( "welcome" )
|
105
115
|
expect( path ).to match /\/welcome$/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: given_filesystem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- given_filesystem.gemspec
|
43
43
|
- lib/given_filesystem.rb
|
44
44
|
- lib/given_filesystem/spec_helpers.rb
|
45
|
+
- spec/data/hello/world
|
45
46
|
- spec/data/testcontent
|
46
47
|
- spec/data/welcome/space/.gitkeep
|
47
48
|
- spec/data/welcome/universe
|
@@ -73,4 +74,3 @@ signing_key:
|
|
73
74
|
specification_version: 4
|
74
75
|
summary: A library for setting up files as test data
|
75
76
|
test_files: []
|
76
|
-
has_rdoc:
|