rspec-terraform 0.1.0.pre.40 → 0.1.0.pre.41

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
  SHA256:
3
- metadata.gz: 12e11f477f99fd41080131cf322d8d6dedf40645e04bb41b66de3b5cee3128b5
4
- data.tar.gz: 47ccbe633464a8a414b9ea950a27c664bae5bef3e60155463b9a979f398900ac
3
+ metadata.gz: 6abf52967c937d8a7761aab1289a1a244ed440bd735311360d3888c3746d8e39
4
+ data.tar.gz: ef8e4d1ed48f86632623785b6fafa69bef6bc38c63d902c3897ea8083c31bc7a
5
5
  SHA512:
6
- metadata.gz: 19aa8f5adeedf3bc1a71129205363f7eca9a843d47462345c34ee8a36358ee35e9d4ad2ea9bf1ac63bb8846c789181c88039428cc1514bfbd1f500ce3ca7b145
7
- data.tar.gz: 3c338a356d1ad4ff0264f1bcef7e756ea743c0f3582865bb62cfaadcc6bb539b4467a7c239836cb0c5f285362d313d9f1ab22aca62203d55816cdc8855c69287
6
+ metadata.gz: 2034dd4ce31339bd6e6e834adfba4d0fc7ca894e532e2e0ef1e4e06efd24c3596d5daf2317933c5d4ee50c0da88ee3188840ed141a9a20492f9ba5d66c97ac1f
7
+ data.tar.gz: d41ffaa70e27cedc9f6dcaceb2aeec825be58c9bb41cc8344e9780d7cc1f9db77b8f44dba89da6cb159beabcfa6febac2c0ea93d76bd831f33a163b380bd39eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-terraform (0.1.0.pre.40)
4
+ rspec-terraform (0.1.0.pre.41)
5
5
  confidante (>= 0.27)
6
6
  rspec (>= 3.0)
7
7
  ruby-terraform (= 1.7.0.pre.16)
@@ -66,13 +66,34 @@ module RSpec
66
66
  end
67
67
 
68
68
  def devices(opts)
69
+ streams = opts[:streams]
70
+ file_path = opts[:file_path]
71
+ stdout = opts[:stdout]
72
+
69
73
  {
70
- file: log_device(opts[:file_path] || File::NULL),
71
- stdout: log_device(opts[:stdout] || $stdout),
72
- stderr: log_device($stderr)
74
+ file: log_device(resolve_file_path(file_path, streams)),
75
+ stdout: log_device(resolved_stdout(stdout)),
76
+ stderr: log_device(resolved_stderr)
73
77
  }
74
78
  end
75
79
 
80
+ def resolve_file_path(file_path, streams)
81
+ resolved_file_path = File::NULL
82
+ if streams.include?(:file) && file_path
83
+ FileUtils.mkdir_p(File.dirname(file_path))
84
+ resolved_file_path = file_path
85
+ end
86
+ resolved_file_path
87
+ end
88
+
89
+ def resolved_stdout(stdout)
90
+ stdout || $stdout
91
+ end
92
+
93
+ def resolved_stderr
94
+ $stderr
95
+ end
96
+
76
97
  def log_device(io)
77
98
  Logger::LogDevice.new(io)
78
99
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Terraform
5
- VERSION = '0.1.0.pre.40'
5
+ VERSION = '0.1.0.pre.41'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.40
4
+ version: 0.1.0.pre.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers