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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d439246630c6831a20ad883f60acebde851cc0e
4
- data.tar.gz: 648b3037218f4fa22b546f5be02660b21b7b51ee
3
+ metadata.gz: a37adf41c7d8b7794308031e8b4a8ea85fef4f93
4
+ data.tar.gz: 0bbe94f7a57c0f418b8a5f321047e95f50e7ff03
5
5
  SHA512:
6
- metadata.gz: 217cc2eed4e97eb76c986711e81458edbdb23f5317d190cb4294c6c0c5fd6697a3d1a1694787d8b1563ee7877e76e44a65ade3a0cdf19ad6a86fabebe1376e10
7
- data.tar.gz: e5b0679e414abae396084caf4a1cb38ae6ef2be3117f42594ec1e044ca95cd1cabaaa2e3920d65037bec0eb548f1d1eca21edc4d3e46ca86e9becd71b8a930c1
6
+ metadata.gz: be97672d47aee8a66d4cd06b6e649fc1a67cc95414841de7d6c6abc0c9cba0011ac83dbb312002b37fb2773193036389dc5180e9f827c85a3f41241fc6327971
7
+ data.tar.gz: edfb0e6c40550d33ea19bc4ca0ffe718cdc05050e2e954da38aaac0a5bb50a3e2bd40a4addf89911e087790a28af8c34246102538950b5ee62bad12610a38013
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'given_filesystem'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.license = 'MIT'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Cornelius Schumacher']
@@ -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
- path
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.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: 2014-12-09 00:00:00.000000000 Z
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: